在Cloud Firestore中更新集合名称 [英] Updating a collection name in Cloud Firestore

查看:60
本文介绍了在Cloud Firestore中更新集合名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在Cloud Firestore中更改集合的名称吗?我创建了一个包含200个文档的集合.现在,我想更改集合的名称.在Firebase控制台中,我找不到执行此操作的方法.

Can we change the name of a collection in Cloud Firestore? I have created a collection with 200 documents. Now I want to change the name of the collection. In the Firebase console, I could not find a way to do this.

是否可以通过代码或在控制台中更改集合的名称.还是可以从Firestore中导出文档,创建一个新集合,然后再次导入这些文档?

Is it possible to change a collection's name either through code or in the console. Or Is it possible to export documents from Firestore, create a new collection and then import those documents again?

请帮助.

推荐答案

一旦存在,就无法更改名称或ID或集合或文档.为了建立有效的索引,所有这些数据都是不可变的.

It's not possible to change the names or IDs or collections or documents once they exist. All that data is immutable, for the purpose of building efficient indexes.

您当然可以读出所有内容,然后以新的名称和ID重新放回去.

You could certainly read everything out, then put it all back in with new names and IDs.

这篇关于在Cloud Firestore中更新集合名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆