将文档导入 Google Cloud Firestore。现有的同名文档将被覆盖。导入在后台进行,可以通过创建的操作资源监视和管理其进度。如果取消 Databases.importDocuments 操作,则数据的子集可能已导入到 Cloud Firestore。
HTTP请求
POST https://firestore.googleapis.com/v1beta1/{name=projects/*/databases/*}:importDocuments
URL 使用gRPC 转码语法。
路径参数
参数 | |
---|---|
name | 要导入的数据库。应采用以下形式: |
请求正文
请求正文包含具有以下结构的数据:
JSON 表示 |
---|
{ "collectionIds": [ string ], "inputUriPrefix": string } |
领域 | |
---|---|
collectionIds[] | 要导入哪个集合 ID。未指定表示导入中包含的所有集合。 |
inputUriPrefix | 导出文件的位置。这必须与已成功完成导出的 ExportDocumentsResponse 的 outputUriPrefix 匹配。请参阅: |
响应体
如果成功,响应正文将包含一个Operation
实例。
授权范围
需要以下 OAuth 范围之一:
-
https://www.googleapis.com/auth/datastore
-
https://www.googleapis.com/auth/cloud-platform
有关详细信息,请参阅身份验证概述。