shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/document/products/104447
HTTP/1.1 OK
content-type: application/json; charset=utf-8
etag: "_YYClK6q--_"
x-content-type-options: nosniff
{
"_key" : "104447",
"_id" : "products/104447",
"_rev" : "_YYClK6q--_",
"inhabitants" : {
"china" : 1366980000,
"india" : 1263590000,
"usa" : 319220000
}
}
shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/document/products/104447?mergeObjects=true <<EOF
{
"inhabitants" : {
"indonesia" : 252164800,
"brazil" : 203553000
}
}
EOF
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/document/products/104447
HTTP/1.1 OK
content-type: application/json; charset=utf-8
etag: "_YYClK62--_"
x-content-type-options: nosniff
{
"_key" : "104447",
"_id" : "products/104447",
"_rev" : "_YYClK62--_",
"inhabitants" : {
"china" : 1366980000,
"india" : 1263590000,
"usa" : 319220000,
"indonesia" : 252164800,
"brazil" : 203553000
}
}
shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/document/products/104447?mergeObjects=false <<EOF
{
"inhabitants" : {
"pakistan" : 188346000
}
}
EOF
HTTP/1.1 Accepted
content-type: application/json; charset=utf-8
etag: "_YYClK7K--_"
location: /_db/_system/_api/document/products/104447
x-content-type-options: nosniff
{
"_id" : "products/104447",
"_key" : "104447",
"_rev" : "_YYClK7K--_",
"_oldRev" : "_YYClK62--_"
}
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/document/products/104447
HTTP/1.1 OK
content-type: application/json; charset=utf-8
etag: "_YYClK7K--_"
x-content-type-options: nosniff
{
"_key" : "104447",
"_id" : "products/104447",
"_rev" : "_YYClK7K--_",
"inhabitants" : {
"pakistan" : 188346000
}
}