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: "index_config" }. 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/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*.
This method waits—the workflow execution is paused—until the operation is
complete, fails, or times out. The default timeout value is 1800 seconds (30
minutes) and can be changed to a maximum value of 31536000 seconds (one year)
for long-running operations using the connector_params field. See the
Connectors reference.
The connector uses polling to monitor the long-running operation, which might
generate additional billable steps. For more information about retries and
long-running operations, refer to Understand connectors.
The polling policy for the long-running operation can be configured. To set the
connector-specific parameters (connector_params), refer to
Invoke a connector call.
Arguments
Parameters
name
string
Required. A field name of the form projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path} A field path may be a simple field name, e.g. address or a path to fields within map_value , 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 keycityin the fieldaddress.``represents a field named, not any field. A specialFieldcontains the default indexing settings for all fields. This field's resource name is:projects/{project_id}/databases/{database_id}/collectionGroups/default/fields/Indexes defined on thisFieldwill be applied to all fields which do not have their ownField` 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-09-04 UTC."],[],[],null,["# Method: googleapis.firestore.v1beta2.projects.databases.collectionGroups.fields.patch\n\nUpdates a field configuration. Currently, field updates apply only to\nsingle field index configuration. However, calls to\nFirestoreAdmin.UpdateField should provide a field mask to avoid changing\nany configuration that the caller isn't aware of. The field mask should\nbe specified as: `{ paths: \"index_config\" }`. This call returns a\ngoogle.longrunning.Operation which may be used to track the status of\nthe field update. The metadata for the operation will be the type\nFieldOperationMetadata. To configure the default field settings for the\ndatabase, use the special `Field` with resource name:\n`projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.\n\nThis method waits---the workflow execution is paused---until the operation is\ncomplete, fails, or times out. The default timeout value is `1800` seconds (30\nminutes) and can be changed to a maximum value of `31536000` seconds (one year)\nfor long-running operations using the `connector_params` field. See the\n[Connectors reference](/workflows/docs/reference/googleapis).\n\nThe connector uses polling to monitor the long-running operation, which might\ngenerate additional billable steps. For more information about retries and\nlong-running operations, refer to [Understand connectors](/workflows/docs/connectors).\n\nThe polling policy for the long-running operation can be configured. To set the\nconnector-specific parameters (`connector_params`), refer to\n[Invoke a connector call](/workflows/docs/reference/googleapis#invoke_a_connector_call).\n\nArguments\n---------\n\nRaised exceptions\n-----------------\n\nResponse\n--------\n\nIf successful, the response contains an instance of [`GoogleLongrunningOperation`](/workflows/docs/reference/googleapis/firestore/v1beta2/Overview#GoogleLongrunningOperation).\n\nSubworkflow snippet\n-------------------\n\nSome fields might be optional or required.\nTo identify required fields, refer to the [API documentation](https://cloud.google.com/firestore/docs/reference/rest/v1beta2/projects.databases.collectionGroups.fields/patch). \n\n### YAML\n\n```yaml\n- patch:\n call: googleapis.firestore.v1beta2.projects.databases.collectionGroups.fields.patch\n args:\n name: ...\n updateMask: ...\n body:\n indexConfig:\n indexes: ...\n name: ...\n result: patchResult\n```\n\n### JSON\n\n```json\n[\n {\n \"patch\": {\n \"call\": \"googleapis.firestore.v1beta2.projects.databases.collectionGroups.fields.patch\",\n \"args\": {\n \"name\": \"...\",\n \"updateMask\": \"...\",\n \"body\": {\n \"indexConfig\": {\n \"indexes\": \"...\"\n },\n \"name\": \"...\"\n }\n },\n \"result\": \"patchResult\"\n }\n }\n]\n```"]]