snapshot1 uses and single collection and snapshot2 uses a collection group
final snapshot1 = await FirebaseFirestore.instance
.collection('users')
.doc('115309562732908784445')
.collection('user_activities')
.where('userGroupIDs', arrayContains: 'IIPwobuR3YLrOoLH3TeS')
.get();
final snapshot2 = await FirebaseFirestore.instance
.collectionGroup('user_activities')
.where('userGroupIDs', arrayContains: 'IIPwobuR3YLrOoLH3TeS')
.get();
snapshot1 generates fine by snapshot2 throws
Exception has occurred.
FirebaseException ([cloud_firestore/failed-precondition] Operation was rejected because the system is
not in a state required for the operation's execution. If performing a query, ensure it has been
indexed via the Firebase console.)
but I'm not getting the auto-generate URL. The above message overlapped the VSCode editor window. I didn't see any URL messages in the Debug Console nor the Firestore logs.
Is there something wrong with my query? Or maybe sometimes you have to create them manually?