相关疑难解决方法(0)

如何在Firebase中执行以下查询?(不止一个条件)

考虑以下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不允许多个订单,因此引发了异常......

有任何想法吗?

android firebase

4
推荐指数
1
解决办法
4511
查看次数

标签 统计

android ×1

firebase ×1