I'm creating an Ionic application using Firestore with Angularfire2.
My database structure is as follows:
- creators
- CREATOR_ID
- name (string)
- description (string)
- posts (map)
- category1 (array)
- [POST1, POST2, POST3]
- category2 (array)
- [POST3, POST4, ...]
A creator is able to create posts/articles. And when a creator creates an article he's able to specify which categories that post belongs to!
The thing about the aplication though is, when a user wants to filter by category, it will bring all the CREATORS that contain at least one post in the category the user selected (instead of bringing all the articles in that category).
So, based on the structure above I tried the following:
this.afs.collection<Creator>('creators', ref => ref.where("posts.category1", '>', ""));
But it returns nothing!
Do you guys have any suggestions?
Thanks!