Giter Site home page Giter Site logo

Comments (2)

mariusconjeaud avatar mariusconjeaud commented on August 31, 2024

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.

ziqizhang avatar ziqizhang commented on August 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.