json

index.create

Create a JSON secondary index on a field path.

strata json index create

wire json_create_index

Creates a secondary index over one JSON field path with a numeric, tag, or text kind. Existing documents are indexed at creation and future writes maintain the index automatically. The current wire response is a transitional bare index definition.

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 index create --help

Example

Create a secondary index on a JSON field.

strata json index create by_name $.name --index-type tagstrata json index list

Parameters

NameTypeRequiredDescription
field_pathstringyesIndexed field path.
index_typeJsonIndexTypeyesIndex kind.one of: numeric, tag, text
namestringyesIndex name.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

MutationAck<JsonIndexCreate>

  • dataJsonIndexDefinition
  • 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/index/create.md