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 定義的設定。如要明確移除這個欄位的所有索引,請指定內含空白索引清單的索引設定。

索引設定

這個欄位的索引設定。

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 指定欄位相同的狀態,此時 usesAncestorConfig 會是 truereverting 會是 false

方法

get

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

list

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

patch

更新欄位設定。