I am using Cloud Firestore database in Swift iOS, I want to filter the list of root collection on the basis of values available in each documents' subcollection?
Root Collection --> Posts --> documents--> Subcollection--> document--> fieldvalue
The value of the "fieldvalue" has to decide the list of documents in root collection posts
I tried this below, but it is not working as required.
let postsRef = Firestore.firestore()
.collection("posts")
.document()
.collection("comments")
.whereField("comment_author_id", isEqualTo: Auth.auth().currentUser!.uid)
.whereField("l1", isEqualTo: true)
.limit(to: 50)
please assist

