考虑以下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"
},
}
}
Run Code Online (Sandbox Code Playgroud)
你如何实现以下查询:
SELECT * FROM USERS WHERE groupName="thailand" and registration.time>=1418288589631
Run Code Online (Sandbox Code Playgroud)
我试图像这样做:
fireBase.orderByChild("groupName").startAt("thailand").endAt("thailand").orderByChild("time").startAt("1418288589631")
Run Code Online (Sandbox Code Playgroud)
但由于firebase不允许多个订单,因此引发了异常......
有任何想法吗?