Deletes the root path $ to remove the whole document, or a nested path to remove one field or array element. Missing documents and paths produce a no-op delete acknowledgement rather than an error.
Successful mutations return an acknowledgement that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.
Examples
Delete a document.
CLI
$ strata json set temp $ {"x":1}
$ strata json delete temp $
$ strata json exists temp
Wire
{"key":"temp","path":"$","type":"json_set","value":{"x":1}}
{"key":"temp","path":"$","type":"json_delete"}
{"key":"temp","type":"json_exists"}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
key | string | yes | Document key. |
path | string | yes | JSON path. |
Plus the optional scope: branch and space (default to the session branch and the "default" space).
Returns
MutationAck<JsonDelete>.
Errors
failed_precondition.engine.runtime_closednot_found.engine.branchinvalid_argument.engine.product_spaceinvalid_argument.engine.json_document_idinvalid_argument.engine.json_pathinvalid_argument.engine.json_path_too_longinvalid_argument.engine.json_path_type
Invocation
- CLI:
strata json delete - Wire type:
json_delete