shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/9889 <<EOF
{
"hello" : "world"
}
EOF
HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
etag: "_VReqjcK--_"
location: /_db/_system/_api/document/products/9889
{
"_id" : "products/9889",
"_key" : "9889",
"_rev" : "_VReqjcK--_",
"_oldRev" : "_VReqjcK---"
}
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/9889 <<EOF
{
"numbers" : {
"one" : 1,
"two" : 2,
"three" : 3,
"empty" : null
}
}
EOF
HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
etag: "_VReqjcS---"
location: /_db/_system/_api/document/products/9889
{
"_id" : "products/9889",
"_key" : "9889",
"_rev" : "_VReqjcS---",
"_oldRev" : "_VReqjcK--_"
}
shell> curl --dump - http://localhost:8529/_api/document/products/9889
HTTP/1.1 200 OK
x-content-type-options: nosniff
content-type: application/json; charset=utf-8
etag: "_VReqjcS---"
{
"_key" : "9889",
"_id" : "products/9889",
"_rev" : "_VReqjcS---",
"one" : "world",
"hello" : "world",
"numbers" : {
"one" : 1,
"two" : 2,
"three" : 3,
"empty" : null
}
}
shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/9889?keepNull=false <<EOF
{
"hello" : null,
"numbers" : {
"four" : 4
}
}
EOF
HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
x-content-type-options: nosniff
etag: "_VReqjci---"
location: /_db/_system/_api/document/products/9889
{
"_id" : "products/9889",
"_key" : "9889",
"_rev" : "_VReqjci---",
"_oldRev" : "_VReqjcS---"
}
shell> curl --dump - http://localhost:8529/_api/document/products/9889
HTTP/1.1 200 OK
x-content-type-options: nosniff
content-type: application/json; charset=utf-8
etag: "_VReqjci---"
{
"_key" : "9889",
"_id" : "products/9889",
"_rev" : "_VReqjci---",
"one" : "world",
"numbers" : {
"empty" : null,
"one" : 1,
"three" : 3,
"two" : 2,
"four" : 4
}
}