【发布时间】:2017-07-23 09:27:44
【问题描述】:
我对 firebase 的索引有一些疑问。这是我的火力基地结构:
merchants {
merchantID1 : {
merchantName :
branches : {
branchID1 : {
branchAddress :
}
}
}
}
我在 firebase 站点的索引规则:
"merchants": {
".indexOn": ["merchantName"]
},
我从 JavaScript 获得了两个不同的 orderByChild 查询。一个是查询merchantName,另一个是branchAddress。在我在 firebase 添加indexOn merchantName rule 后,警告消息消失了。但是,当我执行另一个查询 branchAddress 的函数时,我收到以下警告消息:
FIREBASE WARNING: Using an unspecified index. Consider adding ".indexOn":
"branchAddress" at /merchants/-KpeV5_lnWA2Zd_g7x8C/branches to your security
rules for better performance
如何在孩子的不同级别实际指定 indexOn 规则?
【问题讨论】:
标签: javascript performance firebase firebase-realtime-database