json
index.drop
Drop a JSON secondary index by name.
strata json index dropdb.json.drop_index(name: 'str') -> 'Any'wire json_drop_index
Drops the named JSON secondary index and its stored entries. Documents are unaffected. The current wire response is a transitional boolean status.
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 drop --helphelp(db.json.drop_index)
Example
Drop a secondary index.
strata json index create by_name $.name --index-type tagstrata json index drop by_namestrata json index list
_ = db.json.create_index("by_name", "$.name", index_type="tag")_ = db.json.drop_index("by_name")[i.name for i in db.json.list_indexes()]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | yes | Index name. |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| space | string or null | no | Target product space. Defaults to `"default"`. |
Returns
MutationAck<JsonIndexDrop>
- databoolean
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| not_found.engine.branch | never | not_applicable |
| invalid_argument.engine.product_space | never | not_started |
| invalid_argument.engine.json_index_name | never | not_started |
| invalid_argument.engine.json_index_name_reserved | never | not_started |