I want to get snapshot depends on its value if it has for example "red" or "green" colors only. Can i do that in one observe? or should i do two observers
here is example json:
"users" : {
"EeLIxkOEfhMUlsM8WGnHdgeT8xW2" : {
"id-854" : { // I want this
"color" : "red"
},
"id-451" : { // and this
"color" : "green"
},
"id-153" : {
"color" : "yellow"
}
},
code:
self.ref.child("users").child(handleUser).queryOrdered(byChild: "color").queryEqual(toValue: "red").observe(.childAdded, with: { (snapshot) in
print(snapshot) // i got red snapshot
}, withCancel: nil)}
so what's the best way to get two different values, And can i get them with one observe? Thanks!