'How-to find non existing ids in Firestore?

I have a Firestore collection with many documents.

I receive from another system, a list of (8000) ids, and I need to create new Firestore documents when some ids are missing.

How can I query my Firestore collection to get only missing ids from given list ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source