Reputation: 11
I'm using for first time collection groups querys on firestore in my web application but I can't retrive any data and I don't know why
I'm using Firebase SDK 7.6.1 and I have created the indexes correctly i think. This is my Collection data structure:
And this are my Indexes:
And finally the code with I'm trying to retrieving data is:
doc = this.database.collectionGroup('Authors')
.where('Name','==',this.TextParams.trim().toLowerCase());
I expected to retrieve the documents where the author name is equal to my TextParams variable
Upvotes: 0
Views: 162
Reputation: 317750
In your screenshot, Authors is not a subcollection, it's an array type field. Since it's not a subcollection, a collection group query won't work at all. Also, it's currently not possible to search among array field items.
What you will have to do is actually put your Authors into a subcollection.
Upvotes: 1