1
0
Fork 0
arangodb/Documentation/Examples/RestDocumentHandlerPatchDoc...

98 lines
2.0 KiB
Plaintext

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