REST Resource: projects.databases.collectionGroups.fields

资源:字段

表示数据库中的单个字段。

字段按其“集合组”(代表数据库中具有相同 ID 的所有集合)进行分组。

JSON 表示法
{
  "name": string,
  "indexConfig": {
    object (IndexConfig)
  }
}
字段
name

string

字段名称,格式为 projects/{projectId}/databases/{databaseId}/collectionGroups/{collectionId}/fields/{fieldPath}

字段路径可能是简单的字段名称,例如address 或 mapValue 中字段的路径,例如address.city 或特殊字段路径。唯一有效的特殊字段是 *,它表示任何字段。

字段路径可以使用 (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),[,]` 以及任何 ASCII 符号字符引用。

示例:(注意:此处的注释采用 Markdown 语法编写,因此还有一个额外的反引号层来表示代码块)\address.city`represents a field namedaddress.city, not the map key cityin the fieldaddress. `*`represents a field named*`,而不是任何字段。

特殊的 Field 包含所有字段的默认索引设置。此字段的资源名称为 projects/{projectId}/databases/{databaseId}/collectionGroups/__default__/fields/*。在此 Field 上定义的索引将应用于没有专属 Field 索引配置的所有字段。

indexConfig

object (IndexConfig)

此字段的索引配置。如果未设置,字段索引编制将还原为 ancestorField 定义的配置。如需明确移除此字段的所有索引,请指定包含空索引列表的索引配置。

索引配置

此字段的索引配置。

JSON 表示法
{
  "indexes": [
    {
      object (Index)
    }
  ],
  "usesAncestorConfig": boolean,
  "ancestorField": string,
  "reverting": boolean
}
字段
indexes[]

object (Index)

此字段支持的索引。

usesAncestorConfig

boolean

仅限输出。如果为 true,系统会根据 ancestorField 指定的配置来设置 Field 的索引配置。如果为 false,系统会明确定义 Field 的索引配置。

ancestorField

string

仅限输出。指定从哪个 Field 的资源名称中设置此字段的索引配置(当 usesAncestorConfig 为 true 时),或者如果此字段没有索引配置(当 usesAncestorConfig 为 false 时),将从中设置它的索引配置。

reverting

boolean

仅在值为 true 时输出,表示 Field 的索引配置正在还原过程中。完成后,索引配置将转换为与 ancestorField 指定的字段相同的状态,此时 usesAncestorConfig 将为 truereverting 将为 false

方法

get

获取字段的元数据和配置。

list

列出此数据库的字段配置和元数据。

patch

更新字段配置。