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