考虑以下 firebase 结构:
{
"users" : {
"00:03:aa:dc:1c:2b" : {
"firstName" : " Ofek",
"groupName" : "thailand",
"lastName" : "Ron",
"registration" : {
"type" : "regular",
"time" : 1418288589636
},
"phoneNumber" : "345345345"
},
"04:46:65:8D:60:C6" : {
"firstName" : " Ofek",
"groupName" : "thailand",
"lastName" : "Ron",
"registration" : {
"type" : "regular",
"time" : 1418288589630
},
"phoneNumber" : "345345345"
},
}
}
如何实现以下查询:
SELECT * FROM USERS WHERE groupName="thailand" and registration.time>=1418288589631
我试图这样做:
fireBase.orderByChild("groupName").startAt("thailand").endAt("thailand").orderByChild("time").startAt("1418288589631")
但这引发了异常,因为 firebase 不允许多个 order by...
有任何想法吗?
Firebase 目前仅支持单个orderBy
每个查询。
因此,如果您想要对多个属性进行过滤(或排序),您要么必须在 JavaScript 代码中在客户端进行额外的过滤(或排序),要么必须提出自己的索引方案结合了这些属性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)