WIP: support batch updates via HTTP
now supports batch via HTTP.
A batch is a JSON seent on Post with following headers and similar body:
Headers :
x-barrel-write-batch: true
x-barrel-async: false
JSON:
{ "updates": [
{ "op": "put", "doc": {}, "rev": "" },
{ "op": "delete", "id": "someid", "rev": "" },
{ "op": "post", "doc": {} }
]}
Response is the following
if Async is true: { "ok" : true }
Or following response
{
"ok": true,
"results": [
{"status": "ok", "id": "docid", "rev": "revid" },
]
}
Results can be
- {"status": "ok", "id": "docid", "rev": "revid" }
- {"status": "error", "reason": "not found" }
- {"status": "conflict", "reason": "doc exists" }
- {"status": "conflict", "reason": "revision conflic" }
fix #57 (closed)