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 包含所有欄位的預設索引設定。這個欄位的資源名稱為:這個 Field 中定義的 projects/{projectId}/databases/{databaseId}/collectionGroups/__default__/fields/* 個索引會套用至所有沒有專屬 Field 索引設定的欄位。

indexConfig

object (IndexConfig)

這個欄位的索引設定。如未設定,欄位索引功能會還原為 ancestorField 定義的設定。如要明確移除這個欄位的所有索引,請使用空白的索引清單指定索引設定。

IndexConfig

這個欄位的索引設定。

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

object (Index)

這個欄位支援的索引。

usesAncestorConfig

boolean

僅供輸出。如果為 true,Field 的索引設定是根據 ancestorField 指定的設定進行。如果設為 False,系統會明確定義 Field 的索引設定。

ancestorField

string

僅供輸出。指定已設定這個欄位索引設定時所用 Field 的資源名稱 (如果 usesAncestorConfig 為 true),或如果這個欄位沒有索引設定,則「會」設定該名稱 (當 usesAncestorConfig 為 false)。

reverting

boolean

僅輸出為 true 時,Field 的索引設定正在進行還原。完成後,索引設定會轉換為與 ancestorField 指定欄位相同的狀態,在這個時間點上 usesAncestorConfigtruereverting 則為 false

方法

get

取得欄位的中繼資料和設定。

list

列出這個資料庫的欄位設定和中繼資料。

patch

更新欄位設定。