Creating unique relationship using java api

3 views
Skip to first unread message

Cherie Pun

unread,
May 18, 2016, 5:05:05 PM5/18/16
to Neo4j
Hi, 

I am wondering is there a way to create a unique relationship from nodeA to nodeB using just the java api? Or must I execute a cypher query for that?
Also, if both ways are available, which way is more efficient? Thanks.

Sukaant Chaudhary

unread,
May 18, 2016, 5:40:59 PM5/18/16
to ne...@googlegroups.com
I think Cypher Query will be better.

It will be something like:
MATCH (root { name: 'root' })
CREATE UNIQUE (root)-[:LOVES]-(someone)
RETURN someone
Hope this helps!

-Sukaant Chaudhary


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages