What one could do at a lower level is to create operations like db.obtainUniqueNode(Map properties,String...idProperties); node.obtainUniqueRelationship(dir, type, props, String...idProperties); node.obtainUniqueRelationship(dir, type, targetNode, props, String...idProperties);
which handle the lock, index lookup and property-update in one go. That operation can be exposed on the REST layer. Michael Am 06.08.2011 um 11:22 schrieb espeed: > > Peter Neubauer wrote: >> >> Would a simple check in a new REST endpoint to the job or do you think >> this >> should be further down in the index configuration supporting unique >> properties and throwing an exception or silently update a property if a >> second insertion call comes? >> > > Hi Peter - > > Do you mean an REST endpoint that returns true/false if a node with the > property exists? > > I'm looking at this from the context of batch inserts where you may be > adding 400 Facebook friends or 2000 Twitter followers and would want to > avoid the overhead of several hundreds of REST requests. The question is how > far down the line to put it. > > I have brought this up with Stephen in regard to Rexster. If you guys are > planning on implementing a unique index, it may make sense for this to be at > the DB level and then give Rexster the ability to use multiple DB-specific > indices, such as Neo4j Fulltext, Neo4j Spatial, and something like a Neo4j > unique index if that's on its way. > > - James > > > -- > View this message in context: > http://neo4j-community-discussions.438527.n3.nabble.com/Are-Unique-Indices-in-the-Works-tp3229971p3230765.html > Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user