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