现已推出具有 MongoDB 兼容性的 Firestore 企业版!
了解详情。
配額與限制
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
僅適用於 Cloud Firestore Enterprise 版。
|
本頁面說明與 MongoDB 相容的 Cloud Firestore 要求配額與限制。
免費版用量
與 MongoDB 相容的 Cloud Firestore 提供免費層級,讓您無須付費即可開始使用這項服務。下表列出免費方案的配額。
系統每天會套用免費方案額度,並在太平洋時間午夜重設。
每個專案只能有一個與 MongoDB 相容的 Cloud Firestore 資料庫適用免費方案。
在沒有免費方案資料庫的專案中建立第一個資料庫時,系統會將該資料庫納入免費方案。如果刪除套用免費方案的資料庫,下一個建立的資料庫就會套用免費方案。
免費方案 |
配額 |
儲存的資料量 |
1 GiB |
讀取單位 |
每天 50,000 次 |
寫入單位 |
每日 4 萬名 |
傳出資料移轉 |
每月 10 GiB |
下列作業和功能不包含免費用量。
如要使用下列功能,請啟用計費功能:
如要進一步瞭解這些功能的計費方式,請參閱儲存空間定價。
標準限制
下表列出與 MongoDB 相容的 Cloud Firestore 使用限制。除非另有註明,否則這些都是硬性限制。
資料庫
集合、文件和欄位
限制 |
詳細資料 |
集合名稱限制 |
- 必須使用有效的 UTF-8 字元
- 長度不得超過 1,500 個位元組
- 不得與以下規則運算式相符:
__.*__
- 不得包含
$
- 不得為空字串 (
"" )
- 不得包含空值字元
- 開頭不得為 `system.`,也不得包含 `.system.`。
|
文件 ID 限制 (_id ) |
- 文件
_id (頂層欄位) 必須是 ObjectId、字串、64 位元整數、32 位元整數、Double 或 Binary。系統不支援其他 BSON 類型。
- 長度不得超過 1,500 個位元組
字串 ID:
- 必須使用有效的 UTF-8 字元
- 不得為空字串 (
"" )
- 不得與以下規則運算式相符:
__.*__
- 如果是 64 位元整數 ID,則不支援 64 位元 0 (0L)。
|
檔案大小上限 |
4 MiB |
欄位名稱限制 |
- 必須使用有效的 UTF-8 字元
- 不得為空字串 (
"" )
- 不得與以下規則運算式相符:
__.*__
|
欄位名稱大小上限 |
1,500 個位元組 |
欄位路徑大小上限 |
1,500 個位元組 |
欄位值大小上限 |
4 MiB 減去 89 個位元組 |
對應關係或陣列中欄位的深度上限 |
20
對應關係和陣列欄位會為物件的整體深度新增一個層級。舉例來說,下列物件的總深度為三層:
{
nested_object: { #depth 1
nested_array: [ #depth 2
{
foo: "bar" #depth 3
}
]
}
}
|
讀取、寫入和交易
限制 |
詳細資料 |
查詢的記憶體限制 |
128 MiB |
交易時間限制 |
270 秒,閒置到期時間為 60 秒 |
索引
限制 |
詳細資料 |
資料庫的索引數量上限 |
1000
如要提高這項上限,請與支援團隊聯絡。
|
每個文件的索引項目數量上限
|
40,000
|
索引中的欄位數量上限 |
100 |
索引項目大小上限 |
7.5 KiB
|
文件的索引項目大小總和上限 |
8 MiB
|
存留時間 (TTL)
限制 |
詳細資料 |
資料庫的存留時間設定數量上限 |
500
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\n\n|--------------------------------------------------------|\n| *Relevant to Cloud Firestore Enterprise edition only.* |\n\n\u003cbr /\u003e\n\nThis page describes the request quotas and limits for Cloud Firestore with MongoDB compatibility.\n\nFree tier usage\n\nCloud Firestore with MongoDB compatibility offers a free tier that lets you get started with\nCloud Firestore with MongoDB compatibility at no cost. The free tier amounts are listed in the following\ntable.\n\nFree tier amounts are applied daily and reset at midnight Pacific time.\n\nThe free tier applies to only one Cloud Firestore with MongoDB compatibility database per project.\nThe first database that is created in a project without a free tier database\nwill get the free tier. If the database with the free tier applied is deleted,\nthe next database created will receive the free tier.\n\n\u003cbr /\u003e\n\n| Free tier | Quota |\n|------------------------|------------------|\n| Stored data | 1 GiB |\n| Read units | 50,000 per day |\n| Write units | 40,000 per day |\n| Outbound data transfer | 10 GiB per month |\n\n\u003cbr /\u003e\n\nThe following operations and features don't include free usage.\nYou must [enable billing](https://cloud.google.com/billing/docs/how-to/modify-project) to use these features:\n\n- Managed deletes (TTL)\n- Backup data\n- Restore operations\n\nFor more information about how these features are billed, see\n[Storage pricing](https://cloud.google.com/firestore/enterprise/pricing#storage-size#storage-size).\n\nStandard limits\n\nThe following tables show the limits that apply to\nCloud Firestore with MongoDB compatibility. These are hard limits unless otherwise noted.\n\nDatabases\n\n| Limit | Details |\n|--------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Maximum number of databases per project | 100 [Contact support](https://cloud.google.com/support-hub) to request an increase to this limit. |\n| Maximum number of [customer-managed encryption keys (CMEK) databases](/docs/firestore/enterprise/cmek) per project | 0 By default the quota is 0 because this feature is behind an allowlist. You can request to increase the quota by filling in [the CMEK access request form](https://docs.google.com/forms/d/e/1FAIpQLSfKs8wJf4IXu1NizvfyU2vT59JDbdPvkehMVZ2ab5l_aDLIIA/viewform?resourcekey=0-O15dlRFvA0JIDmh6VFUEcA). |\n\nCollections, documents, and fields\n\n| Limit | Details |\n|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Constraints on collection names | - Must be valid UTF-8 characters - Must be no longer than 1,500 bytes - Can't match the regular expression `__.*__` - Can't contain `$` - Can't be the empty string (`\"\"`) - Can't contain the null character - Can't begin with \\`system.\\` and can't contain \\`.system.\\`. |\n| Constraints on document IDs (`_id`) | - Document `_id` (top-level field) must be an ObjectId, String, 64-bit integer, 32-bit integer, Double, or Binary. Other BSON types are not supported. - Must be no longer than 1,500 bytes - For String IDs: - Must be valid UTF-8 characters - Can't be the empty string (`\"\"`) - Can't match the regular expression `__.*__` - For 64-bit integer IDs, 64-bit 0 (0L) is not supported. |\n| Maximum size for a document | 4 MiB |\n| Constraints on field names | - Must be valid UTF-8 characters - Can't be the empty string (`\"\"`) - Can't match the regular expression `__.*__` |\n| Maximum size of a field name | 1,500 bytes |\n| Maximum size of a field path | 1,500 bytes |\n| Maximum size of a field value | 4 MiB - 89 bytes |\n| Maximum depth of fields in a map or array | 20 Map and array fields add one level to the overall depth of an object. For example, the following object has a total depth of three levels: ``` { nested_object: { #depth 1 nested_array: [ #depth 2 { foo: \"bar\" #depth 3 } ] } } ``` |\n\nReads, writes, and transactions\n\n| Limit | Details |\n|------------------------------|----------------------------------------------------|\n| Memory limit for a query | 128 MiB |\n| Time limit for a transaction | 270 seconds, with a 60-second idle expiration time |\n\nIndexes\n\n| Limit | Details |\n|--------------------------------------------------------|----------------------------------------------------------------------------------------------------|\n| Maximum number of indexes for a database | 1000 [Contact support](https://cloud.google.com/support-hub) to request an increase to this limit. |\n| Maximum number of index entries for each document | 40,000 |\n| Maximum number of fields in an index | 100 |\n| Maximum size of an index entry | 7.5 KiB |\n| Maximum sum of the sizes of a document's index entries | 8 MiB |\n\nTime to live (TTL)\n\n| Limit | Details |\n|-----------------------------------------------------|---------|\n| Maximum number of TTL configurations for a database | 500 |"]]