I read the Firebase documentation about this, but the documentation conveniently left the detail about equalsTo
examples out. I also see some other related questions, but none give me answer about how to filter children with two values.
So the database is more or less like this:
users: {
as9d8f7a89sdf7a: {
username: admin,
password: test123,
timestamp: 38410238912,
priviledge: { }
},
asd9fasd90f8a0s: {
username: moderator,
password: hello456,
timestamp: 12937129383,
priviledge: { }
}
}
I'm looking for something like this:
databaseRef.child("users").childEqualsTo("username", usernameTf.text).childEqualsTo("password", passwordTf.text)
But from what I gathered, the closest thing I can do to search for this is:
databaseRef.child("users").orderByChild("username").equalsTo(usernameTf.text)
And then manually loop for the result's password if I can find any match? Is this correct?