Docs menu · Reference

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 that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.

Examples

Create a secondary index on a JSON field.

CLI

$ strata json index create by_name $.name tag
$ strata json index list

Wire

{"field_path":"$.name","index_type":"tag","name":"by_name","type":"json_create_index"}
{"type":"json_list_indexes"}

Parameters

NameTypeRequiredDescription
field_pathstringyesIndexed field path.
index_typeJsonIndexTypeyesIndex kind.
namestringyesIndex name.

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

Returns

MutationAck<JsonIndexCreate>.

Errors

Invocation

  • CLI: strata json index create
  • Wire type: json_create_index

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