我嘗試這樣做db.collection("posts").collection("comments").get(),db.collection("posts/comments").get()但似乎都不起作用。
uj5u.com熱心網友回復:
子集合位于特定檔案下。為了訪問comments特定帖子的子集合,您需要在路徑中指定該帖子 ID:
db.collection("posts").doc("post ID you want").collection("comments").get()
如果要訪問所有comments集合中的檔案,則需要使用集合組查詢:
db.collectionGroup("comments").get()
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/375809.html
