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

77 lines
1.7 KiB
Plaintext

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