同一Firebase项目中的更多数据库 [英] More databases inside the same Firebase Project

查看:33
本文介绍了同一Firebase项目中的更多数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Firebase项目中的新控制台中,数据库选项卡中的项目设置会话中,标签为数据库.

In the new Console in a Firebase Project, in Project Setting session in the Database tab there is the label Databases.

但是,我没有发现在同一Firebase项目中创建多个数据库的任何操作.

However I didn't find any action to create more than 1 database inside the same Firebase Project.

是否可以在同一Firebase项目中创建更多数据库?

Is it possible to create more databases inside the same Firebase Project?

推荐答案

多数据库是一项新功能,允许您创建多个数据库实例.

Multi-database is a new feature that allows you to create multiple database instances.

要开始使用,您需要进入 Blaze计划..在数据查看器中,您可以单击三点图标以创建新的数据库实例:

To get started you need to be in the Blaze plan. In the data viewer you can click the triple dot icon to create new database instances:

要从辅助实例访问数据,请在创建数据库实例时使用绝对URL.

To access data from a secondary instance you use an absolute URL when creating a database instance.

const app = firebase.initializeApp({
  // use your main config
  databaseUrl: "https://multi-db.firebaseio.com/"
});
const db1 = app.database(); // This is the default DB
const db2 = app.database("https://multi-db501c7.firebaseio.com/");

由于这些数据库位于同一项目中,因此它们共享相同的身份验证会话.

Since these databases are in the same project they share the same Authentication session.

每个数据库实例还具有自己的一组安全规则,并且数据库可以处理不同的结构.

Also each database instance has its own set of security rules and the databases can handle different structures.

这篇关于同一Firebase项目中的更多数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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