Consider the following JSON format in Firebase database -
"root":
{
"question":
{
"1":
{
"category":"A",
"replies":0
},
"2":
{
"category":"B",
"replies":1
},
"3":
{
"category":"B",
"replies":0
},
"4":
{
"category":"C",
"replies":2
}
}
}
For getting all questions with replies = 0, I do,
Query query = rootReference.child("question").orderByChild("replies").equalTo(0);
which works perfectly.
But what should I do if I want those questions with replies not equal to 0 ?