i am trying to fetch firestore snapshot but it always return null , i don't know where is the problem ..
my rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth.uid != null;
}
}
}
my code 1:
await Firestore.instance.document("myDB/EG/EG/Cairo Governorate").collection("Alexandria Governorate").limit(10).getDocuments().then((snapshot)async{
print(snapshot.documents);//[]
});
my code 2:
await Firestore.instance.document("myDB/EG/EG/Cairo Governorate/Alexandria Governorate").get().then((snapshot)async{
print(snapshot.data);//null
});