cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo4j NodeJS OGM

natamvo
Node Link

Hello there!

I've been looking for a way to use neo4j in a NodeJS application that I was doing and I ended up not finding any "lib" that fit my project, with this I started a OGM.

The idea is to bring the use of OGMs closer than we are used to with other Mapping (ORM, noSQL, ...)

I would be very grateful for your feedback.

6 REPLIES 6

Nice library, it's an interesting approach. Out of interest, is there any reason why you didn't go with neode?

natamvo
Node Link

I tried neode but there was a lot of use cases that not worked for me and the more important was to bring the usage close to an ORM.
I have to say thanks for you, because I read everything on your code and it was very important for me.

Hi Natamvo,
I have some experience with MongoDB/Mongoose on Nodejs but am new to Neo4j. I expect that an OGM would be beneficial to my project and am evaluating Neode and your node-ogm. Can you summarize what you see as the differences between the two?
Thanks,
Joel

natamvo
Node Link

I will list some features that made me created the lib:
lets thing in users-[:HAS_MANY]-address-[:IN]-country

  • filter by relations attributes { key: "users_address.active", value: true}
    • here I can keep history of relations, but my business rule is for active networks
  • get relations change every time that I try to find
    • neode has eager on schema, or its true or you have to do always get('address') everytime that you wanted
    • in my case you control that everytime (like an ORM) user(with_address).find or only user.find, the call is not based on schema
  • create getters and setters on my object
    • you can rewrite the validation for get and set on attribute, so you are free to do your on validation
    • the lib still have the commons patterns (date, string, integer, float, hash, ...)
    • that validation is util when you need to one field be equals others and thing like that
  • you can do optional matches
    • I did way for you execute optional matches, for example user-with_address, if you do that I will bring the user and if has address will be filled, if not will be a empty collection, or you can use user-with_!address and the ! shows me that you and user that have address

Maybe something I just didn't find a way to do on neode, but those were some of the reason
And like I said before you will notice that I work with classes and more oriented to the Model (like an ORM)

Natamvo,
I will digest this information and may get back to you
Thanks,
Joel

natamvo
Node Link

Btw, there is a ROADMAP that I will share on the lib soon.
maybe you will find things to do as well.

but I will appreciate it your feedback