Can I POST multiple patch requests to RavenDB's /bulk_docs HTTP API endpoint? -


i'm in process of writing node wrapper ravendb.

i'm using version 3 there no http docs it, i've been relying on 2.0 , 2.5 docs.

in regards single document operations, i've used this doc page puts, deletes , multiple patchs individual documents.

similarly, i've used this doc page multiple puts , deletes of several documents in 1 http call but docs bit vague in regards patching mutliple documents in 1 call.

under "batching requests" heading, states it's possible:

request batching in ravendb handled using '/bulk_docs' endpoint, accepts array of operations execute. format operations is:

method - put, patch or delete.

...

for puts, post /bulk_docs:

[   {     method: 'put',     key: 'users/1',     document: { username: 'dummy' }     metadata: { 'raven-entity-type': 'users' }   },   ... ] 

for deletes, post /bulk_docs:

[   {     method: 'delete',     key: 'users/1'   },   ... ] 

for patchs, i've tried posting following without luck:

[   {     method: 'patch',     key: 'users/1',     document: {       type: 'set',       name:'username',       value: 'new-username'     }   },   ... ] 

and

[   {     method: 'patch',     key: 'users/1',     type: 'set',     name:'username',     value: 'new-username'   },   ... ] 

all i'm getting 500 - internal server error , without examples of patching multiple documents on docs page i'm kind of stuck...

any appreciated :)

the structure patch :

[   {     method: 'patch',     key: 'users/1',     patches: [{ type: 'set',         name:'username',         value: 'new-username' }]   },   ... ] 

the full structure can see here: https://github.com/ayende/ravendb/blob/master/raven.abstractions/commands/patchcommanddata.cs#l72


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -