Unique Indexes and REST

30 views
Skip to first unread message

Nigel Small

unread,
Sep 18, 2012, 6:20:22 AM9/18/12
to Neo4J, Robin Edwards
Hi chaps

We are currently working with unique indexes via the REST interface and it seems that we could do with a finer-grained level of control with regards to the operations available, particularly when batching up a number of requests.

Currently, we can quite happily call a "get_or_create" style operation which will return 201 if a node (or relationship) is indexed and 200 if it one already exists for that key-value pair. A desired alternative however would be to have a "create_or_fail" type operation which could return 201 or 400 instead. Importantly, this operation would stop the batch in progress and roll back the transaction.

Perhaps the URI could accept a flag something like:


WDYT?
Nige

kantube

unread,
Sep 18, 2012, 10:08:29 AM9/18/12
to ne...@googlegroups.com, Robin Edwards
Nigel,

uniqueness=create_or_fail will return either 200 or 409 (conflict)

http://docs.neo4j.org/chunked/snapshot/rest-api-unique-indexes.html

this is available in 1.9 snapshot.


Nigel Small

unread,
Sep 18, 2012, 11:55:56 AM9/18/12
to ne...@googlegroups.com, Robin Edwards
That's awesome, thanks a lot :-)

Nige



--
 
 

Reply all
Reply to author
Forward
0 new messages