我們目前正在使用本地模式的Cloud Firestore開發一個AppEngine標準應用,該應用運行得非常好。
現在,我們想支持一個需要復合索引的查詢,我們嘗試使用index.yaml檔案來創建:
indexes:
- kind: myentity
屬性。
- name: owner
方向: asc
- name: created_at
方向: asc
當用gcloud app deploy index.yaml測驗時,我們觀察到索引正在被創建。然而,創建的索引是云端資料存盤索引,而不是云端Firestore索引,盡管Datastore "甚至沒有啟用"(如果你試圖訪問Datastore視圖,云端控制臺希望將你直接發送到Firestore視圖)。
因此,我們的查詢是失敗的。
我們如何指示AppEngine創建Firestore索引而不是Datastore索引?
uj5u.com熱心網友回復:
對于Firestore(本地模式)的復合索引,您可以使用gcloud cli或cloud console。
如果您想在組態檔中檢入您的索引,您也可以使用Terraform。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/317593.html
標籤:
