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