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