json

set

Set a JSON value at a document path, creating the document when missing.

strata json set

wire json_set

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 of the outcome: for a state-changing write, the affected target with the mutation effect and commit facts; for mutations that produce a domain result (such as a branch or a promotion outcome), that result object.

To see the complete help for this command, run:

strata json set --help

Example

Store a JSON document, then read it back.

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

Parameters

NameTypeRequiredDescription
keystringyesDocument key.
pathstringyesJSON path.
valueanyyesJSON value.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

MutationAck<JsonWrite>

  • dataobject
  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

← All 16 JSON commands

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