有没有办法在Firebase REST API中深入查询?

时间:2015-07-07 23:57:31

标签: firebase

我有以下数据。我想为所有拥有" c"的用户查询它。 - (真或其他)。

repos/users.json?orderBy=???

我可以用REST API解决这个问题吗?

{
  "repos": {
    "my_repo": {
      "tags": {
        "a": true,
        "b": true,
        "c": true,
        "d": true
      }
    },
    "users": {
      "kevin": {
        "a": true,
        "c": true
      },
      "bob": {
        "b": true,
        "c": true
      },
      "alice": {
        "a": true,
        "d": true
      }
    }
  }
}

1 个答案:

答案 0 :(得分:0)

You can query from "users" for the values.

ref = new Firebase("https://xxxx.firebaseio.com/repos/user/").orderByChild("c").equ‌​alsTo("true");

The equalsTo is only quoted in my example, depending on how you set it in your data. If it is a string, you need the quotes, if not, then adjust to match your dataset.

See Firebase Documentation