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