Reputation: 801
Consider I have a list of String ["id1", "id2", "id3", ...]
Is there any way to check if these IDs are present in firestore db without a for loop.
And is it worthy of checking each ID at a time(considering the list.length > 10,000
)?
Upvotes: 0
Views: 74
Reputation:
I too agree with @Doug Stevenson's answer. Also you could try to write a server side function and then use that function to do the same. This will make the server work for you and will be much faster
Upvotes: 0
Reputation: 317712
If you want to check if a document exists, you have to read it with get() and check the result. If you have 10,000 documents to check, you will need to do this 10,000 times. There is no operation for checking the existence of multiple documents.
Upvotes: 3