firebase - 我如何专门查询firebase实时数据库中的字段
问题描述
阅读文档后,我一直在尝试对 firebase 数据库进行一些查询,但我不太了解发生了什么,我实际上想要获得字段标记“God is good”。这是我的代码
const ref = db.ref("songs") // reference to the database
try {
ref.orderByChild(`God is good`).on("value", function(snapshot) {
console.log(snapshot.val()); // the returned data from database
snapshot.forEach(function(data) {
});
});
} catch (error) {
throw error
}
finally {
}
所有数据条目都返回。
解决方案
推荐阅读
- java - 我无法在 ubuntu 19.04 中为 java 制作 opencv
- javascript - Expo Client TypeError:网络请求失败
- java - 尝试运行时,我的 Dropwizard JAR 找不到 config.yml 文件
- php - 使用 MySQL 和 PHPMyAdmin 时灯箱不显示图像
- javascript - 如何将 jquery 数据表中的一行移动到 buttonclick 的顶部 ..?
- bash - 使用 Bash 检查时间戳是否在接下来的 N 分钟窗口内
- angular - 当 i18nMissingTranslation 设置为忽略时,消息错过翻译
- javascript - 创建一个函数来更新一个表
- yii2 - 使用 foreach yii2 的自定义数据提供程序
- python - 在python中创建n个唯一名称的字典