Short
I can't get neo to update existing node properties in a batched rest op.
Long
I want to create a batch operation that inserts/updates a node inside an index. It should handle three use-cases:
- if the node does not exist, insert it with the given properties set
- if the node exists, update it's properties set with the new values, if any.
I'm using the batch operation api, I wrote a test where I'm issuing two requests: Short 1. first one inserts the node and indexes it's properties 2. second one simply updates some properties of the node
Here's the first request:
[ { "method": "POST", "to": "/index/node/events?uniqueness=get_or_create", "id": 1, "body": { "key": "id", "value": "222222222", "properties": { "id": "222222222", "type": "event-type" } } }, { "method": "POST", "to": "/index/node/events", "body": { "uri": "{1}", "key": "id", "value": "222222222" } }, { "method": "POST", "to": "/index/node/events", "body": { "uri": "{1}", "key": "type", "value": "event-type" } } ]
And now the second one.
[ { method: 'POST', to: '/index/node/events?uniqueness=get_or_create', id: 1, body: { key: 'id', value: '222222222', properties: {id: '222222222', type: 'event-type', title: 'SUPEREVENT'} } }, { method: 'POST', to: '/index/node/events', body: { uri: '{1}', key: 'id', value: '222222222' } }, { method: 'POST', to: '/index/node/events', body: { uri: '{1}', key: 'type', value: 'event-type' } }, { method: 'POST', to: '/index/node/events', body: { uri: '{ 1 }', key: 'title', value: 'SUPEREVENT' } } ]
NOTE! that on the second request i'm adding and event title
property with value SUPEREVENT
. This does not get persisted nor indexed. Why? and how can I fix it?
Thank you, Alex