Method: projects.databases.documents.listDocuments
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
GET https://firestore.googleapis.com/v1/{parent=projects/*/databases/*/documents}/{collectionId}
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
parent |
string
必要欄位。父項資源名稱。格式為:projects/{projectId}/databases/{databaseId}/documents 或 projects/{projectId}/databases/{databaseId}/documents/{document_path} 。 例如 projects/my-project/databases/my-database/documents 或 projects/my-project/databases/my-database/documents/chatrooms/my-chatroom
|
collectionId |
string
選用設定。要列出的集合 ID (相對於 parent )。 例如 chatrooms 或 messages 。 此為選用項目。如未提供,Firestore 會在提供的 parent 底下列出所有集合的文件。
|
查詢參數
參數 |
pageSize |
integer
選用設定。單一回應中傳回的文件數量上限。 Firestore 傳回的值可能會少於這個值。
|
pageToken |
string
選用設定。接收自先前 documents.list 回應的網頁權杖。 提供此項目即可擷取後續網頁。進行分頁時,所有其他參數 (pageSize 除外) 都必須與產生網頁權杖的要求中設定值相符。
|
orderBy |
string
選用設定。可選擇傳回文件的順序。 例如 priority desc, __name__ desc 。 這會反映 Firestore 查詢中使用的 ORDER BY ,但以字串表示法表示。不使用時,文件會根據 __name__ ASC 排序。
|
mask |
object (DocumentMask )
選用設定。要傳回的欄位。如果沒有設定,系統會傳回所有欄位。 如果文件的某個欄位未列於這個遮罩中,系統不會在回應中傳回該欄位。
|
showMissing |
boolean
清單是否應顯示遺漏的文件。 文件不存在時就不見了,但下方有子文件巢狀結構。如果設為「是」,系統將傳回缺少的這類文件以及鍵,但不會設定欄位、createTime 或 updateTime 。 含有 showMissing 的要求無法指定 where 或 orderBy 。
|
聯集參數 consistency_selector 。這筆交易的一致性模式。如果未設定,則預設為同步一致性。consistency_selector 只能是下列其中一項: |
transaction |
string (bytes format)
在既有交易中執行讀取作業。 Base64 編碼的字串。
|
readTime |
string (Timestamp format)
在提供的時間點執行讀取作業。 這個值必須是過去 1 小時內的微秒精確度,如果已啟用「時間點復原」功能,則可以是過去 7 天內的整分鐘時間戳記。 採用 RFC3339 世界標準時間「Zulu」格式的時間戳記,採用奈秒解析度和最多九個小數位數。範例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
回應主體
如果成功,回應主體會包含 ListDocumentsResponse
的執行例項。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/datastore
https://www.googleapis.com/auth/cloud-platform
詳情請參閱驗證總覽。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-04-12 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]