Adding a unique node

20 views
Skip to first unread message

Avron Olshewsky

unread,
Dec 11, 2014, 9:08:31 AM12/11/14
to node-...@googlegroups.com
All, 

Just "playing" with node and neo4j.

I have managed to save two nodes with a relationship between them.

so I have :

var data1 = { 
         prop1: somevalue1, 
         prop2: somevalue1
}

var data2 = { 
         prop1: somevalue2, 
         prop2: somevalue2
}

var node1 = db.createNode(data1); 
var node2 = db.createNode(data2); 

node1.save( _ );
node2.save( _ );
node1.createRelationshipTo(node2, 'SomeRelationship', {}, _ );

I would like to do the same thing however I would like to ensure that if a new node is created it is unique, is there a simple way to do this ?



Reply all
Reply to author
Forward
0 new messages