1
0
Fork 0
arangodb/Documentation/Examples/RestDocumentHandlerPatchDoc...

75 lines
1.7 KiB
Plaintext

shell> curl --data-binary @- --dump - http://localhost:8529/_api/document/products/1529669239
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
etag: "1529669239"
{
"inhabitants" : {
"china" : 1366980000,
"india" : 1263590000,
"usa" : 319220000
},
"_id" : "products/1529669239",
"_rev" : "1529669239",
"_key" : "1529669239"
}
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/1529669239?mergeObjects=true
{
"inhabitants" : {
"indonesia" : 252164800,
"brazil" : 203553000
}
}
shell> curl --data-binary @- --dump - http://localhost:8529/_api/document/products/1529669239
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
etag: "1530193527"
{
"inhabitants" : {
"china" : 1366980000,
"india" : 1263590000,
"usa" : 319220000,
"indonesia" : 252164800,
"brazil" : 203553000
},
"_id" : "products/1529669239",
"_rev" : "1530193527",
"_key" : "1529669239"
}
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/1529669239?mergeObjects=false
{
"inhabitants" : {
"pakistan" : 188346000
}
}
HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "1530652279"
location: /_db/_system/_api/document/products/1529669239
{
"error" : false,
"_id" : "products/1529669239",
"_rev" : "1530652279",
"_key" : "1529669239"
}
shell> curl --data-binary @- --dump - http://localhost:8529/_api/document/products/1529669239
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
etag: "1530652279"
{
"inhabitants" : {
"pakistan" : 188346000
},
"_id" : "products/1529669239",
"_rev" : "1530652279",
"_key" : "1529669239"
}