how to fetch all docouments with an ID that doesnt exist in the given array? (Cloud Firestore)

Viewed 133

I have an array of IDs. Now, I would like to fetch all documents that DO NOT exist in that array.

Lets say let array = ["id1", "id2", "id3];

and document IDs in Firestore: "id1", "id2", "id3", "id4", "id5".

So basically I need to fetch only the docs with "id4" and "id5";

I thought of using this but I am not sure how exactly:

const westCoastCities = citiesRef.where('regions', 'array-contains', 'west_coast').get();

I am new to Firebase so please be patient with me.

1 Answers
Related