【发布时间】:2020-06-08 07:56:43
【问题描述】:
我正在尝试使用以下命令将 google firestore 数据导出到云存储位置。
gcloud firestore export gs://<bucketName>/<folderName> --collection-ids=<collectionName>
我想进一步按字段名称值或日期范围过滤集合,可以这样做吗?云功能解决方案也欢迎。
这是我的 js 解决方案
console.log('data export bucket', bucket);
const databaseName = client.databasePath(
process.env.GCLOUD_PROJECT,
'project_name'
);
const response = await client
.exportDocuments({
name: databaseName,
outputUriPrefix: bucket,
// Leave collectionIds empty to export all collections
// or define a list of collection IDs:
// collectionIds: ['users', 'posts']
collectionIds: tables,
});
console.log('successfully exportToGCS', response);
}```
【问题讨论】:
标签: google-cloud-platform collections google-cloud-firestore export google-cloud-storage