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