---
title: "PATCH /v1/{+name}"
method: PATCH
path: "/v1/{+name}"
tags: ["projects"]
---

# PATCH /v1/{+name}

`PATCH /v1/{+name}`

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/*`.

## Path parameters

- `name` string, required

## Query parameters

- `updateMask` string
- `currentDocument.updateTime` string
- `mask.fieldPaths` string[]
- `requestOptions.requestTags` string[]
- `updateMask.fieldPaths` string[]

## Request body

- GoogleFirestoreAdminV1Field — Represents a single field in the database. Fields are grouped by their "Collection Group", which represent all collections in the database with the same ID.
  - `name` string — Required. A field name of the form: `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path can 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 can be quoted using `` ` `` (backtick). The only character that must 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: `` `address.city` `` represents a field named `address.city`, not the map key `city` in the field `address`. `` `*` `` 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/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own `Field` index configuration.
  - `indexConfig` GoogleFirestoreAdminV1IndexConfig — The index configuration for this field.
    - `indexes` GoogleFirestoreAdminV1Index[] — The indexes supported for this field.
      - `multikey` boolean — Optional. Whether the index is multikey. By default, the index is not multikey. For non-multikey indexes, none of the paths in the index definition reach or traverse an array, except via an explicit array index. For multikey indexes, at most one of the paths in the index definition reach or traverse an array, except via an explicit array index. Violations will result in errors. Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
      - `state` 'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'NEEDS_REPAIR' — Output only. The serving state of the index.
      - `name` string — Output only. A server defined name for this index. The form of this name for composite indexes will be: `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` For single field indexes, this field will be empty.
      - `apiScope` 'ANY_API' | 'DATASTORE_MODE_API' | 'MONGODB_COMPATIBLE_API' — The API scope supported by this index.
      - `fields` GoogleFirestoreAdminV1IndexField[] — The fields supported by this index. For composite indexes, this requires a minimum of 2 and a maximum of 100 fields. The last field entry is always for the field path `__name__`. If, on creation, `__name__` was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the `__name__` will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field.
        - `arrayConfig` 'ARRAY_CONFIG_UNSPECIFIED' | 'CONTAINS' — Indicates that this field supports operations on `array_value`s.
        - `order` 'ORDER_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING' — Indicates that this field supports ordering by the specified order or comparing using =, !=, <, <=, >, >=.
        - `searchConfig` GoogleFirestoreAdminV1SearchConfig — The configuration for how to index a field for search.
          - `textSpec` GoogleFirestoreAdminV1SearchTextSpec — The specification for how to build a text search index for a field.
            - `indexSpecs` GoogleFirestoreAdminV1SearchTextIndexSpec[] — Required. Specifications for how the field should be indexed. Repeated so that the field can be indexed in multiple ways.
              - …
          - `geoSpec` GoogleFirestoreAdminV1SearchGeoSpec — The specification for how to build a geo search index for a field.
            - `geoJsonIndexingDisabled` boolean — Optional. Disables geoJSON indexing for the field. By default, geoJSON points are indexed.
        - `vectorConfig` GoogleFirestoreAdminV1VectorConfig — The index configuration to support vector search operations
          - `dimension` integer — Required. The vector dimension this configuration applies to. The resulting index will only include vectors of this dimension, and can be used for vector search with the same dimension.
          - `flat` GoogleFirestoreAdminV1FlatIndex — An index that stores vectors in a flat data structure, and supports exhaustive search.
        - `fieldPath` string — Can be __name__. For single field indexes, this must match the name of the field or may be omitted.
      - `unique` boolean — Optional. Whether it is an unique index. Unique index ensures all values for the indexed field(s) are unique across documents.
      - `searchIndexOptions` GoogleFirestoreAdminV1SearchIndexOptions — Options for search indexes at the definition level.
        - `textLanguageOverrideFieldPath` string — Optional. The field in the document that specifies which language to use for that specific document. For indexes with MONGODB_COMPATIBLE_API ApiScope: if unspecified, the language is taken from the "language" field if it exists or from `text_language` if it does not.
        - `textLanguage` string — Optional. The language to use for text search indexes. Used as the default language if not overridden at the document level by specifying the `text_language_override_field`. The language is specified as a BCP 47 language code. For indexes with MONGODB_COMPATIBLE_API ApiScope: If unspecified, the default language is English. For indexes with `ANY_API` ApiScope: If unspecified, the default behavior is autodetect.
      - `shardCount` integer — Optional. The number of shards for the index.
      - `queryScope` 'QUERY_SCOPE_UNSPECIFIED' | 'COLLECTION' | 'COLLECTION_GROUP' | 'COLLECTION_RECURSIVE' — Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection ID. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection ID as this index.
      - `density` 'DENSITY_UNSPECIFIED' | 'SPARSE_ALL' | 'SPARSE_ANY' | 'DENSE' — Immutable. The density configuration of the index.
    - `reverting` boolean — Output only When true, the `Field`'s index configuration is in the process of being reverted. Once complete, the index config will transition to the same state as the field specified by `ancestor_field`, at which point `uses_ancestor_config` will be `true` and `reverting` will be `false`.
    - `usesAncestorConfig` boolean — Output only. When true, the `Field`'s index configuration is set from the configuration specified by the `ancestor_field`. When false, the `Field`'s index configuration is defined explicitly.
    - `ancestorField` string — Output only. Specifies the resource name of the `Field` from which this field's index configuration is set (when `uses_ancestor_config` is true), or from which it *would* be set if this field had no index configuration (when `uses_ancestor_config` is false).
  - `ttlConfig` GoogleFirestoreAdminV1TtlConfig — The TTL (time-to-live) configuration for documents that have this `Field` set. A timestamp stored in a TTL-enabled field will be used to determine the expiration time of the document. The expiration time is the sum of the timestamp value and the `expiration_offset`. For Enterprise edition databases, the timestamp value may alternatively be stored in an array value in the TTL-enabled field. An expiration time in the past indicates that the document is eligible for immediate expiration. Using any other data type or leaving the field absent will disable expiration for the individual document.
    - `state` 'STATE_UNSPECIFIED' | 'CREATING' | 'ACTIVE' | 'NEEDS_REPAIR' — Output only. The state of the TTL configuration.
    - `expirationOffset` string, google-duration — Optional. The offset, relative to the timestamp value from the TTL-enabled field, used to determine the document's expiration time. `expiration_offset.seconds` must be between 0 and 2,147,483,647 inclusive. Values more precise than seconds are rejected. If unset, defaults to 0, in which case the expiration time is the same as the timestamp value from the TTL-enabled field.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/firestore.md) · [All operations](https://skmtc.net/google/apis/firestore/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/firestore/versions/11bc07a83431/schema)
