【发布时间】:2019-07-17 04:02:16
【问题描述】:
我正在尝试根据某些条件(例如分数是否大于 50)使用邮递员从 firebase 获取数据。为此,我应该根据文档链接在我的 JSON 文件中添加索引: https://firebase.google.com/docs/database/security/indexing-data.html
所以我根据文档编写的代码是:
{
"rules": {
"scores": {
".indexOn": ".value"
}
},
"scores": {
"bruhathkayosaurus" : 55,
"lambeosaurus" : 21,
"linhenykus" : 80,
"pterodactyl" : 93,
"stegosaurus" : 5,
"triceratops" : 22
}
}
但是当我将此 json 上传到 firebase 时,我收到了错误:
无效的 JSON。键不能为空或包含 $# [ ] / 或 。
我不知道我写错了什么。规则应该写在其他地方还是其他格式?我是初学者,所以知识不多。
【问题讨论】:
标签: json firebase firebase-realtime-database postman