Stay organized with collections
Save and categorize content based on your preferences.
Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to FirestoreAdmin.UpdateField should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: { paths: "indexConfig" }.
This call returns a google.longrunning.Operation which may be used to track the status of the field update. The metadata for the operation will be the type FieldOperationMetadata.
To configure the default field settings for the database, use the special Field with resource name: projects/{projectId}/databases/{databaseId}/collectionGroups/__default__/fields/*.
A field name of the form projects/{projectId}/databases/{databaseId}/collectionGroups/{collectionId}/fields/{fieldPath}
A field path may be a simple field name, e.g. address or a path to fields within mapValue , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.
Field paths may be quoted using (backtick). The only character that needs
to be escaped within a quoted field path is the backtick character itself,
escaped using a backslash. Special characters in field paths that
must be quoted include:*,.,
``` (backtick),[,]`, as well as any ascii symbolic characters.
Examples: (Note: Comments here are written in markdown syntax, so there is an additional layer of backticks to represent a code block) \address.city`represents a field namedaddress.city, not the map key
cityin the fieldaddress.
`*`represents a field named*`, not any field.
A special Field contains the default indexing settings for all fields. This field's resource name is: projects/{projectId}/databases/{databaseId}/collectionGroups/__default__/fields/* Indexes defined on this Field will be applied to all fields which do not have their own Field index configuration.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-02 UTC."],[[["\u003cp\u003eThis API endpoint updates the configuration of a single field index within a Firestore database.\u003c/p\u003e\n"],["\u003cp\u003eWhen updating a field, a field mask \u003ccode\u003e{ paths: "indexConfig" }\u003c/code\u003e must be provided to prevent unintended changes.\u003c/p\u003e\n"],["\u003cp\u003eThe API call returns an \u003ccode\u003eOperation\u003c/code\u003e object that can be used to track the status of the update.\u003c/p\u003e\n"],["\u003cp\u003eDefault field settings for a database can be configured using the special \u003ccode\u003eField\u003c/code\u003e resource name: \u003ccode\u003eprojects/{projectId}/databases/{databaseId}/collectionGroups/__default__/fields/*\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe field name specified when calling this API must follow the structure \u003ccode\u003eprojects/{projectId}/databases/{databaseId}/collectionGroups/{collectionId}/fields/{fieldPath}\u003c/code\u003e and can be a path within mapValues, a simple field name or a special field path.\u003c/p\u003e\n"]]],[],null,["# Method: projects.databases.collectionGroups.fields.patch\n\nUpdates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to [FirestoreAdmin.UpdateField](/firestore/docs/reference/rest/v1beta2/projects.databases.collectionGroups.fields/patch#google.firestore.admin.v1beta2.FirestoreAdmin.UpdateField) should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: \"indexConfig\" }`.\n\nThis call returns a [google.longrunning.Operation](/firestore/docs/reference/rest/Shared.Types/Operation) which may be used to track the status of the field update. The metadata for the operation will be the type `FieldOperationMetadata`.\n\nTo configure the default field settings for the database, use the special `Field` with resource name: `projects/{projectId}/databases/{databaseId}/collectionGroups/__default__/fields/*`.\n\n### HTTP request\n\n`PATCH https://firestore.googleapis.com/v1beta2/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body contains an instance of [Field](/firestore/docs/reference/rest/v1beta2/projects.databases.collectionGroups.fields#Field).\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/firestore/docs/reference/rest/Shared.Types/Operation).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/datastore`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]