{
"Events" : {
"16" : {
"eventDate" : "2021-02-02",
"eventId" : "16",
"eventName" : "First Test",
"eventTime" : "09:39:00"
},
"22" : {
"eventDate" : "2021-02-02",
"eventId" : "22",
"eventName" : "Test22 Exam",
"eventTime" : "09:39:00"
},
"26" : {
"eventDate" : "2021-02-02",
"eventId" : "26",
"eventName" : "Webinar",
"eventTime" : "09:39:00"
}
}
}
If I'm storing my Events
like this, and I want to get the node where EventId
is equal to 16 and 26.
How can I do that?
The above is the child of issue, which is a child of root.
I Tried with equalTo but get only single record. I need to get 16 and 26 both.
DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
Query query = reference.child("Events").orderByChild("eventId").equalTo("16");