Docs menu · Reference

Writes a JSON value at a path inside a document, creating the document and any missing intermediate objects when needed. Setting the root path $ replaces the whole document; setting a nested path like $.profile.name updates one field and records a new document version.

Successful mutations return an acknowledgement that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.

Examples

Store a JSON document, then read it back.

CLI

$ strata json set user $ {"age":30,"name":"alice"}
$ strata json get user $

Wire

{"key":"user","path":"$","type":"json_set","value":{"age":30,"name":"alice"}}
{"key":"user","path":"$","type":"json_get"}

Parameters

NameTypeRequiredDescription
keystringyesDocument key.
pathstringyesJSON path.
valueanyyesJSON value.

Plus the optional scope: branch and space (default to the session branch and the "default" space).

Returns

MutationAck<JsonWrite>.

Errors

Invocation

  • CLI: strata json set
  • Wire type: json_set

agents: this page as markdown → /docs/reference/json/set.md