Unique value in neo4j nodes

How to determine some value must be unique in Neo4j?

for example, I want to store user data in node, so the username must be unique. Is there a way to do this, like what we do in sql (define username as unique properties)?

+7
source share
1 answer

To do this, you will need to use the node index and the unique functions available in the API to ensure that only one node is served under each key-value pair. If you are working with Neo4j embedded, look at:

For the REST interface, you may have uniqueness support already in the library you are using, or if you are not using the library, this page should help:

Since node structures are not executed in the same way that record structures are used in most DBMSs, there is no direct equivalent to the UNIQUE KEY function that you mention. However, the uniqueness of the index should give you the same end result.

Hope this helps

Nige

+13
source

All Articles