The following page discusses how to check if a given document exists in Firestore:
How to know if document exists in firestore python?
But in my case, I need to figure out whether a collection exists or not in Firestore database. And at that point in time when I need to check this in the code, I do not know potential document IDs of a given collection. From the above thread, I saw the following provided by @Nebulastic:
doc_ref = db.collection('my_collection').document('my_document')
doc = doc_ref.get()
if doc.exists:
logging.info("Found")
else:
logging.info("Not found")
But how can I check if a collection exists or not without knowing anything about its documents (document names/IDs)?