請記住,當您在 Cloud Firestore 中構建數據時,您有幾個不同的選擇:
- 文件
- 多個集合
- 文檔中的子集合
考慮每個選項的優勢,因為它們與您的用例相關。本指南概述了分層數據的一些示例結構。
文檔中的嵌套數據
您可以在文檔中嵌套複雜的對象,例如數組或映射。
|
|
子集合
當您擁有可能隨時間擴展的數據時,您可以在文檔中創建集合。
|
|
根級集合
在數據庫的根級別創建集合以組織不同的數據集。
|
|
請記住,當您在 Cloud Firestore 中構建數據時,您有幾個不同的選擇:
考慮每個選項的優勢,因為它們與您的用例相關。本指南概述了分層數據的一些示例結構。
您可以在文檔中嵌套複雜的對象,例如數組或映射。
|
|
當您擁有可能隨時間擴展的數據時,您可以在文檔中創建集合。
|
|
在數據庫的根級別創建集合以組織不同的數據集。
|
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-06-29 UTC.