Articles I've read/tried before:
- Firestore search array contains for multiple values
- Performing a complex query with firestore v9
- Firestore collection to array of objects with Firebase v9
- FirebaseError: Expected type 'Tc', but it was: a custom Ac object,
- https://softauthor.com/firebase-firestore-get-document-by-id/
I have a Firestore that looks like this
- The current feature I'm trying to implement is a block list. Whenever you go to the person's profile, you click block, and the person doing the blocking's UID is stored as the doc id and the blocked user's id is added to the "blockedUserId" array
- The home page displays all the posts and I've been trying to filter the displayed posts to not include posts from any of the users in that "blockedUserId" array
- How do I go about doing this correctly?
Here is the attempted code
query(
collection(getFirestore(fireApp), "posts"),
orderBy("uid"),
where(
"uid",
"not-in",
doc(getFirestore(fireApp), "block", "vXLCRjlhOVW6oFOJvtmML6OolKA2")
)