如何将所有firestore数据导出到csv的excel?

问题描述 投票:0回答:2

在我的数据库中有一个用户表,该表中有许多文档(用户),每个文档中有许多子集合。我想将所有用户表及其所有子集合导出到 Excel 或 csv。是否可以 ?可以导出全部数据吗?

数据库用户集合

其中一个子集合的图像

firebase csv google-cloud-firestore export-to-csv
2个回答
1
投票

要从 Google Firestore 导出数据,您可以使用 gcloud 命令行工具将数据导出为 JSON 文件。

以下是从 Google Firestore 导出数据的步骤:

  1. 安装 gcloud 命令行工具(如果尚未安装)。您可以在此处找到安装 gcloud 的说明:https://cloud.google.com/sdk/install

  2. 打开终端或命令提示符并导航到要保存导出数据的目录。

  3. 使用以下 gcloud 命令导出 Firestore 数据:

    gcloud firestore export gs://[BUCKET_NAME]
  1. 最后你可以使用 pandas 或 microsoft excel 将导出的 json 文件转换为 csv 或 excel

使用标志“--output-uri-prefix”指定文件格式

gcloud firestore export gs://[BUCKET_NAME] --output-uri-prefix=[OUTPUT_URI_PREFIX].json

官方文档


0
投票

firefoo 是将 CSV/json 导入 Firestore 并将 firestore 导出到 csv/json 的最快且非常舒适的工具。

https://firefoo.app/docs/firestore-export-import/export-csv

© www.soinside.com 2019 - 2024. All rights reserved.