shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/document/products/103324 <<EOF
{
"hello" : "world"
}
EOF
HTTP/1.1 undefined
content-type: application/json; charset=utf-8
etag: "_XWq5sNe--B"
location: /_db/_system/_api/document/products/103324
x-content-type-options: nosniff
{
"_id" : "products/103324",
"_key" : "103324",
"_rev" : "_XWq5sNe--B",
"_oldRev" : "_XWq5sNe--_"
}
shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/document/products/103324 <<EOF
{
"numbers" : {
"one" : 1,
"two" : 2,
"three" : 3,
"empty" : null
}
}
EOF
HTTP/1.1 undefined
content-type: application/json; charset=utf-8
etag: "_XWq5sNu--_"
location: /_db/_system/_api/document/products/103324
x-content-type-options: nosniff
{
"_id" : "products/103324",
"_key" : "103324",
"_rev" : "_XWq5sNu--_",
"_oldRev" : "_XWq5sNe--B"
}
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/document/products/103324
HTTP/1.1 undefined
content-type: application/json; charset=utf-8
etag: "_XWq5sNu--_"
x-content-type-options: nosniff
{
"_key" : "103324",
"_id" : "products/103324",
"_rev" : "_XWq5sNu--_",
"one" : "world",
"hello" : "world",
"numbers" : {
"one" : 1,
"two" : 2,
"three" : 3,
"empty" : null
}
}
shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/document/products/103324?keepNull=false <<EOF
{
"hello" : null,
"numbers" : {
"four" : 4
}
}
EOF
HTTP/1.1 undefined
content-type: application/json; charset=utf-8
etag: "_XWq5sOG--_"
location: /_db/_system/_api/document/products/103324
x-content-type-options: nosniff
{
"_id" : "products/103324",
"_key" : "103324",
"_rev" : "_XWq5sOG--_",
"_oldRev" : "_XWq5sNu--_"
}
shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/document/products/103324
HTTP/1.1 undefined
content-type: application/json; charset=utf-8
etag: "_XWq5sOG--_"
x-content-type-options: nosniff
{
"_key" : "103324",
"_id" : "products/103324",
"_rev" : "_XWq5sOG--_",
"one" : "world",
"numbers" : {
"empty" : null,
"one" : 1,
"three" : 3,
"two" : 2,
"four" : 4
}
}