Re: [Neo4j] Primary keys with NEO4J?

1,554 views
Skip to first unread message

Jim Webber

unread,
Apr 5, 2013, 4:36:33 AM4/5/13
to ne...@googlegroups.com
Hi Rodger,

> Does NEO4J support primary keys, or unique indexes at all?

You can give any node or relationship a key that you consider to be primary.

> So that, you don't insert a node twice?

Yes, there's unique creation:

http://docs.neo4j.org/chunked/stable/transactions-unique-nodes.html

It's surfaced in Cypher:

http://docs.neo4j.org/chunked/milestone/query-create-unique.html

Jim

Rodger

unread,
Jul 19, 2013, 10:32:25 AM7/19/13
to ne...@googlegroups.com
Hello Jim, 


Thanks for responding. 


At:

CREATE UNIQUE only works for distinct relationships, correct?

Is there a similar functionality to only create unique nodes, no duplicates?
ie. a person only exists in one node in the entire graph database, but has any number of relationships?



At:
UniqueFactory and putIfAbsent can only be done via java, correct?


Does the same functionality exist in Cypher?



Thanks a lot!

 
Reply all
Reply to author
Forward
0 new messages