Brent Barbata
Brent Barbata

Reputation: 3641

Set Neo4j Uniqueness to NODE_PATH with Neo4jClient

In order to prevent my path from including the same node more than once, I'm looking to be able to set the uniqueness to NODE_PATH either using the .Net Neo4jClient or at the database level in one of the database config files (which, last I heard, wasn't possible).

If this can be done, I'm almost certain it will solve this problem as well:

Cypher Query in Neo4j Returns 'undefined'

Thanks for any help!

Brent

Upvotes: 0

Views: 285

Answers (1)

Tatham Oddie
Tatham Oddie

Reputation: 4290

Brent,

You could use Cypher's CREATE UNIQUE clause to create the relationship:

http://docs.neo4j.org/chunked/1.9.M05/query-create-unique.html#create-unique-create-relationship-if-it-is-missing

If it already exists, it won't do anything.

-- Tatham

Upvotes: 0

Related Questions