Resource: Index
An index definition.
JSON representation |
---|
{ "name": string, "collectionId": string, "fields": [ { object ( |
Fields | |
---|---|
name |
The resource name of the index. Output only. |
collectionId |
The collection ID to which this index applies. Required. |
fields[] |
The fields to index. |
state |
The state of the index. Output only. |
IndexField
A field of an index.
JSON representation |
---|
{
"fieldPath": string,
"mode": enum ( |
Fields | |
---|---|
fieldPath |
The path of the field. Must match the field path specification described by [google.firestore.v1beta1.Document.fields][fields]. Special field path |
mode |
The field's mode. |
Mode
The mode determines how a field is indexed.
Enums | |
---|---|
MODE_UNSPECIFIED |
The mode is unspecified. |
ASCENDING |
The field's values are indexed so as to support sequencing in ascending order and also query by <, >, <=, >=, and =. |
DESCENDING |
The field's values are indexed so as to support sequencing in descending order and also query by <, >, <=, >=, and =. |
ARRAY_CONTAINS |
The field's array values are indexed so as to support membership using ARRAY_CONTAINS queries. |
State
The state of an index. During index creation, an index will be in the CREATING
state. If the index is created successfully, it will transition to the READY
state. If the index is not able to be created, it will transition to the ERROR
state.
Enums | |
---|---|
STATE_UNSPECIFIED |
The state is unspecified. |
CREATING |
The index is being created. There is an active long-running operation for the index. The index is updated when writing a document. Some index data may exist. |
READY |
The index is ready to be used. The index is updated when writing a document. The index is fully populated from all stored documents it applies to. |
ERROR |
The index was being created, but something went wrong. There is no active long-running operation for the index, and the most recently finished long-running operation failed. The index is not updated when writing a document. Some index data may exist. |
Methods |
|
---|---|
|
Creates the specified index. |
|
Deletes an index. |
|
Gets an index. |
|
Lists the indexes that match the specified filters. |