firebase-firestore

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cloud Firestore Database and Operations

Cloud Firestore数据库与操作

Before setting up dependencies, writing data models, or configuring security rules, you MUST always identify the Firestore instance edition.
在设置依赖项、编写数据模型或配置安全规则之前,您必须先确定Firestore实例的版本。

1. Instance Selection and Edition Detection

1. 实例选择与版本检测

Run the following command to list current Firestore databases:
bash npx -y firebase-tools@latest firestore:databases:list
运行以下命令列出当前的Firestore数据库:
bash npx -y firebase-tools@latest firestore:databases:list

A. Instance Found

A. 检测到实例

  1. For each database found, inspect its edition and details:
    bash npx -y firebase-tools@latest firestore:databases:get <database-id>
  2. Ask the user which database instance they wish to target or if they would prefer to create a new instance.
  3. Once the target instance is established:
    • If the
      edition
      is
      STANDARD
      , follow the guides under
      references/standard/
      .
    • If the
      edition
      is
      ENTERPRISE
      or native mode, follow the guides under
      references/enterprise/
      .
  1. 对于每个检测到的数据库,查看其版本和详细信息:
    bash npx -y firebase-tools@latest firestore:databases:get <database-id>
  2. 询问用户希望针对哪个数据库实例操作,或者是否需要创建新实例。
  3. 确定目标实例后:
    • 如果**
      edition
      **为
      STANDARD
      ,请遵循
      references/standard/
      下的指南。
    • 如果**
      edition
      **为
      ENTERPRISE
      或原生模式,请遵循
      references/enterprise/
      下的指南。

B. No Instance Found (or New Requested)

B. 未检测到实例(或用户要求创建新实例)

If no databases exist or the user requests a new one, default to provisioning an Enterprise edition database:
bash npx -y firebase-tools@latest firestore:databases:create <database-id> --edition="enterprise" --location="nam5"
- Proceed with using the guides under
references/enterprise/
.

如果不存在任何数据库,或用户要求创建新实例,则默认创建Enterprise版本的数据库:
bash npx -y firebase-tools@latest firestore:databases:create <database-id> --edition="enterprise" --location="nam5"
- 后续请遵循
references/enterprise/
下的指南。

2. Specialized Guides

2. 专项指南

Based on the identified or created instance edition, open and read the corresponding reference guides:
根据识别或创建的实例版本,打开并阅读对应的参考指南:

Standard Edition (
references/standard/
)

Standard Edition(
references/standard/

  • Provisioning: Read provisioning.md
  • Security Rules: Read security_rules.md
  • SDK Usage: Read web_sdk_usage.md
  • Indexes: Read indexes.md
  • 资源配置:阅读 provisioning.md
  • 安全规则:阅读 security_rules.md
  • SDK使用:阅读web_sdk_usage.md
  • 索引:阅读indexes.md

Enterprise Edition / Native Mode (
references/enterprise/
)

Enterprise Edition / 原生模式(
references/enterprise/

  • Provisioning: Read provisioning.md
  • Data Model: Read data_model.md
  • Security Rules: Read security_rules.md
  • SDK Usage: Read web_sdk_usage.md or python_sdk_usage.md
  • Indexes: Read indexes.md
  • 资源配置:阅读 provisioning.md
  • 数据模型:阅读data_model.md
  • 安全规则:阅读 security_rules.md
  • SDK使用:阅读 web_sdk_usage.mdpython_sdk_usage.md
  • 索引:阅读indexes.md