我有以下数据。我想为所有拥有" 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
}
}
}
}
答案 0 :(得分:0)
You can query from "users" for the values.
ref = new Firebase("https://xxxx.firebaseio.com/repos/user/").orderByChild("c").equalsTo("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.