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