- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有人知道如何使用实时数据库模拟器吗?
我可以使用如下所示的函数和 firestore 模拟器。
import functions from '@react-native-firebase/functions';
import firestore from '@react-native-firebase/firestore';
functions().useFunctionsEmulator('http://localhost:5001');
firestore().settings({ host: 'localhost:8080' });
但无法找到类似的实时数据库。任何链接/视频表示赞赏。
谢谢。
最佳答案
基本上是 Frank van Puffelen 发布的解决方案是正确的。然而,这让我陷入了一段时间,所以我将分享我的经验,为其他人节省时间。
import { firebase } from "@react-native-firebase/database";
const database = firebase
.app()
.database("http://localhost:9000?ns=YOUR_DATABASE_NAMESPACE");
const ref = database.ref(`yourPath`)
...
这里有一个巨大的陷阱:如果您使用的是 Android 模拟器,则必须使用
const database = firebase
.app()
.database("http://10.0.2.2:9000?ns=YOUR_DATABASE_NAMESPACE");
如果您使用的是真正的 Android 设备,则必须设置 reverse proxy第一:
adb reverse tcp:9000 tcp:9000
然后正常设置数据库
const database = firebase
.app()
.database("http://localhost:9000?ns=YOUR_DATABASE_NAMESPACE");
我没有测试 iOS,但我相信 localhost 应该可以工作。
关于javascript - React-Native-Firebase : RTDB Emulator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62935494/
我正在使用 Firebase RTDB 通过 Flutter 应用访问我的数据。数据具有以下属性: { 'Category': 'Food', 'Product Description': '
我正在使用 Firebase 在电子商务网站中进行托管和数据存储。每个产品都有我存储在 RTDB 中的文本数据和存储在存储桶中的图像。现在,当我在个人资料页面上访问产品时,我必须进行两次调用,一个调用
您好,我想检索数据,但我没有看到任何显示,同时当我的数据库中没有数据时,我的应用程序崩溃了,所以至少看起来连接有效。我也是 Android Studio 的初学者。 注意:这是 an earlier
我正在 Firebase RTDB 中执行如下查询: Future cargarUsuarioEmpresa(String idEmpresa, String idUsuario) async {
我正在尝试确定在实时数据库或 Cloud Firestore 等直接读取数据库中引用 Firebase 存储(谷歌云存储)文件的最佳方式。由于对该数据库的读取操作无法从可以发出 token 和缓存图像
有人知道如何使用实时数据库模拟器吗? 我可以使用如下所示的函数和 firestore 模拟器。 import functions from '@react-native-firebase/functi
我对 Node 和 Firebase 都很陌生,但似乎无法在线找到此错误。 当我尝试通过 Firebase Admin 加载 Firebase 数据库时出现以下错误: TypeError: rtdb.
在这个firestore官方guide ,它说 Local writes in your app will invoke snapshot listeners immediately. This is
我有一个 Firebase 查询,如下所示: this.db.object(`...irrelevent`).query .orderByKey().startAt(startVal).e
我有多个(大)JSON 文件想要添加到 Firebase 实时数据库 (RTBD)。我正在使用 Geofire,因此所有子节点都需要位于同一父节点下。我正在存储静态地理数据,但我想定期分段刷新它。如果
我正在使用 webpack 编译一个 preact/firestore 应用程序,firebase 总体上为我编译的包的大小贡献了 1.7 MB。我正在尝试减少这个数字。 实时数据库和存储一起为包大小
有什么方法可以将 firebase RTDB(不是 FireStore)与 Flutter Stream Builder 一起使用。我搜索了很多次,但找不到一个例子。所有示例都使用 Cloud Fir
为什么我的状态没有使用我直接从 direbase 获取的数据进行更新 我在控制台中获取数据的位置 我在这里做错了什么,错误在这里 最佳答案 更改此: const db = firebase.datab
我正在尝试在运行 Vue + Webpack 的服务器中设置 firebase admin sdk。这是程序。然后我得到一个错误。 vue 初始化 webpack vue-firebase npm i
我是一名优秀的程序员,十分优秀!