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