我可以更改 Firebase RTDB 中的默认数据库吗?
Can I change the default database in Firebase RTDB?
我在Firebase Realtime项目中创建了一个数据库,但现在看来我选择的位置不是最好的选择,所以我想迁移数据。
事实证明,不可能自动 move/migrate 数据库,所以我想我会删除无效的数据库,创建一个新的并将其设置为默认值,然后删除旧的。
不幸的是,这似乎是不可能的,因为默认数据库没有文档中提到的 'Delete' 选项。 API firebase 管理员管理方法也没有列出此功能。
问题是:是否可以/如何将另一个数据库设置为默认数据库?
谢谢并致以最诚挚的问候!
It turns out that there is no possibility to automatically move/migrate the database.
是的,一旦创建数据库,您就无法更改其默认位置。
The question is: is it possible / how to set another database as a default one?
不,您不能创建“另一个”默认数据库。但是,您可以做的是创建一个新的实时数据库实例,该实例可以位于与默认实例完全不同的位置。根据Realtime Database locations的官方文档:
If you create a new Realtime Database instance, you're prompted to select the location of the instance in the Firebase console workflow. Each Realtime Database instance in your project can be located in a different location. The currently supported locations for Realtime Database instances are listed below along with their associated database URL schemes.
然后相应地使用它。这不是默认的,但它确实可以完成这项工作。
另请参阅下文,了解如何为数据库设置不同的位置:
我在Firebase Realtime项目中创建了一个数据库,但现在看来我选择的位置不是最好的选择,所以我想迁移数据。
事实证明,不可能自动 move/migrate 数据库,所以我想我会删除无效的数据库,创建一个新的并将其设置为默认值,然后删除旧的。
不幸的是,这似乎是不可能的,因为默认数据库没有文档中提到的 'Delete' 选项。 API firebase 管理员管理方法也没有列出此功能。
问题是:是否可以/如何将另一个数据库设置为默认数据库?
谢谢并致以最诚挚的问候!
It turns out that there is no possibility to automatically move/migrate the database.
是的,一旦创建数据库,您就无法更改其默认位置。
The question is: is it possible / how to set another database as a default one?
不,您不能创建“另一个”默认数据库。但是,您可以做的是创建一个新的实时数据库实例,该实例可以位于与默认实例完全不同的位置。根据Realtime Database locations的官方文档:
If you create a new Realtime Database instance, you're prompted to select the location of the instance in the Firebase console workflow. Each Realtime Database instance in your project can be located in a different location. The currently supported locations for Realtime Database instances are listed below along with their associated database URL schemes.
然后相应地使用它。这不是默认的,但它确实可以完成这项工作。
另请参阅下文,了解如何为数据库设置不同的位置: