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