The path of the field. Must match the field path specification described by [google.firestore.v1beta1.Document.fields][fields]. Special field path __name__ may be used by itself or at the end of a path. __type__ may be used only at the end of path.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-20 UTC."],[],[],null,["# REST Resource: projects.databases.indexes\n\nResource: Index\n---------------\n\nAn index definition.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"collectionId\": string, \"fields\": [ { object (/docs/firestore/reference/rest/v1beta1/projects.databases.indexes#IndexField) } ], \"state\": enum (/docs/firestore/reference/rest/v1beta1/projects.databases.indexes#State) } ``` |\n\n| Fields ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The resource name of the index. Output only. |\n| `collectionId` | `string` The collection ID to which this index applies. Required. |\n| `fields[]` | `object (`[IndexField](/docs/firestore/reference/rest/v1beta1/projects.databases.indexes#IndexField)`)` The fields to index. |\n| `state` | `enum (`[State](/docs/firestore/reference/rest/v1beta1/projects.databases.indexes#State)`)` The state of the index. Output only. |\n\nIndexField\n----------\n\nA field of an index.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"fieldPath\": string, \"mode\": enum (/docs/firestore/reference/rest/v1beta1/projects.databases.indexes#Mode) } ``` |\n\n| Fields ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `fieldPath` | `string` The path of the field. Must match the field path specification described by \\[google.firestore.v1beta1.Document.fields\\]\\[fields\\]. Special field path `__name__` may be used by itself or at the end of a path. `__type__` may be used only at the end of path. |\n| `mode` | `enum (`[Mode](/docs/firestore/reference/rest/v1beta1/projects.databases.indexes#Mode)`)` The field's mode. |\n\nMode\n----\n\nThe mode determines how a field is indexed.\n\n| Enums ||\n|--------------------|---------------------------------------------------------------------------------------------------------------------------|\n| `MODE_UNSPECIFIED` | The mode is unspecified. |\n| `ASCENDING` | The field's values are indexed so as to support sequencing in ascending order and also query by \\\u003c, \\\u003e, \\\u003c=, \\\u003e=, and =. |\n| `DESCENDING` | The field's values are indexed so as to support sequencing in descending order and also query by \\\u003c, \\\u003e, \\\u003c=, \\\u003e=, and =. |\n| `ARRAY_CONTAINS` | The field's array values are indexed so as to support membership using ARRAY_CONTAINS queries. |\n\nState\n-----\n\nThe 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.\n\n| Enums ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `STATE_UNSPECIFIED` | The state is unspecified. |\n| `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. |\n| `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. |\n| `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. |\n\n| Methods ------- ||\n|----------------------------------------------------------------------------------------|-----------------------------------------------------|\n| ### [create](/docs/firestore/reference/rest/v1beta1/projects.databases.indexes/create) | Creates the specified index. |\n| ### [delete](/docs/firestore/reference/rest/v1beta1/projects.databases.indexes/delete) | Deletes an index. |\n| ### [get](/docs/firestore/reference/rest/v1beta1/projects.databases.indexes/get) | Gets an index. |\n| ### [list](/docs/firestore/reference/rest/v1beta1/projects.databases.indexes/list) | Lists the indexes that match the specified filters. |"]]