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

95 lines
2.0 KiB
Plaintext

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