I'm looking for a way to filter one Firestore collection based on if the UID exists in another collection. I used the term antijoin but really any way of excluding records that dont exist in both. The structure of my firestore is as follows:
.
|- /Users
|- /User_A
|- Message UID 001
|- Message UID 002
|- ...
|- /User_B
|- ...
|- /Messages
|- Message UID 001
|- Message UID 002
|- ...
Id like for a way to filter a query of "/Messages" to exclude those under /User_X (depending on who is logged in). Right now my approach is to query both from /Users/User_X and from /Messages and filter within my code but Im hoping there's a way to avoid transporting mostly unnecessary data especially when it becomes a large collection.