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