Comments (2)
This is the same problem as #788 ; where get_or_create/create_or_update
creates a Cypher MERGE
, using unique properties as key. So in your case, both uid
and name
are used for the merge. But since you let neomodel create the uid
, then you have two different Jill nodes, with different uids
.
This is a wrong behaviour in neomodel in my opinion, as I can see that users would do as you did (let neomodel handle the uid creation); but I also understand the way those methods are built, so I will admit I am undecided about how to fix this.
from neomodel.
I'm also having this problem and I'd appreciate a workaround for updating behaviours for now.
At the moment, I made changes like the following:
class Person(StructuredNode):
#uid = UniqueIdProperty()
name = StringProperty(unique_index=True, required =True, primary_key=True)
age = IntegerProperty(index=True, default=0)
And I do get the expected behaviour. But I don't know what the implications are. At least, I guess you need to make sure the 'name' is unique on every 'create/insert' operation to avoid integrity violations. But I don't now what happens to the uuid in this case, or does it really matter?
Thanks
from neomodel.
Related Issues (20)
- Structured Node `__eq__` works incorrectly for non-persisted nodes.
- Unable to access property values on nodes that inherit from SemiStructuredNode HOT 1
- neomodel_inspect_database - Only writes first relationship HOT 2
- Missing import in contrib __init__ HOT 1
- Neomodel trying to connect to localhost, even if the database is on Aura ( When calling NODE_NAME.nodes.all() ) HOT 2
- `UniqueIdProperty` makes `get_or_create()` function does not work as expected HOT 2
- zero or more relationships in either direction of type RELATIONSHIP_NAME on node (4:2c06737f-f675-4209-a253-42d649d5fc59:395) of class 'NODE_LABEL'
- `Database` was removed from `neomodel.util` and moved into `neomodel.sync_.core` HOT 4
- Cant retrieve additional relations using `fetch_relations` HOT 6
- neomodel_inspect_database does not correctly report date property
- async iterating over nodes is not working HOT 5
- neomodel_inspect_database RelationshipTo model as string HOT 1
- Make async iterator fully async
- concurrent async calls of `get_or_create` lead to duplicate nodes HOT 1
- Test integration of cachetools
- Add support for full-text index creation
- Outdated documentation on relation search gives AttributeError: 'ZeroOrMore' HOT 1
- How to connect nodes in a SemiStructuredNode without defining the Relationship explicitly HOT 1
- Async Cardinality always throwing type error. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neomodel.