aseemk / node-neo4j-template

A template app for using Neo4j from Node.js.
http://node-neo4j-template.herokuapp.com/
216 stars 92 forks source link

create unique node #7

Closed sapkal-manish closed 10 years ago

sapkal-manish commented 11 years ago

How do we create unique node? and I also want unique index on some of my node property. (eg. If my node is a type of user, then it should be unique username, email and mobileno.)

thanks

aseemk commented 10 years ago

I'm sorry I never responded to this, @sapkal-manish!

To create a unique node, the best way with Neo4j 2.0 is to use a uniqueness constraint on a label. This template app hasn't been updated to use those features yet, but it will soon: issue #11.

Pre-Neo4j 2.0, you can simply do an index lookup before creating the user.

Hope that helps, and sorry again for the delay!