I'm using flutter to query the database.
I have a real-time database as below:
I want to select a record by condition: email='test@gmail.com' and password='111111'
I read the solution following link Query based on multiple where clauses in Firebase But it does not compatible with flutter. My code looks like:
var snapshot = await _firestore
.reference()
.child(USERS_TBL)
.orderByChild('email')
.equalTo(email)
.once()
.then((DataSnapshot snapshot) {
print(snapshot.value);
});
output:
{-LeXpDcLqkwS0c1lgP7O: {user_role: USER, password: 111111, gender: 1, last_name: abcee, first_name: abcd, email: test@gmail.com}}
Of course, I can parse value to get password value, but I think there is another solution which is better. How can I do in flutter? Thanks a lot!!!