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