I am using Firebase Firestore database in my project. I have a data structure as below:
- users (Collection)
- user1 (document)
- followingPeople (array)
- 0
- person0
- 1
- person1
- 2
- person2
- 3
- person3
- 0
- followingPeople (array)
- user2 (document)
- followingPeople (array)
- 0
- person0
- 1
- person1
- 0
- followingPeople (array)
- user1 (document)
I need to write a query which finds the users with a specific person in the following people part of the document fields.
For example if I query for the users which following person0 both user1 and user2 will be returned according to my example above.
Any suggestion will be appreciated.