I have this function
Future<Member?> readMember() async {
final docMember = FirebaseFirestore.instance
.collection('users')
.doc(any)
.collection('phone_number')
.doc('1234567890');
final snapshot = await docMember.get();
}
What I actually wanted to do is to query the documents under the collection users then search all the documents against one that contains 1234567890 as the phone_number field.
I need help on this.
CodePudding user response:
Future<Member?> readMember() async {
final docMember = FirebaseFirestore.instance
.collection('users').where('id', isEqualTo: '1234567890');
final snapshot = await docMember.get();
}