Is there a way to check if a sub collection exists in firestore for nodejs?
Currently I am using doc.exists for documents but I need to check if a subco
doc.exists
Mateus' Answer didn't help me. Probably it has been changed over the time.
.collection(..).get() returns a QuerySnapshot which has the property size, so I just did:
.collection(..).get()
size
admin.firestore .collection('users') .doc('uid') .collection('sub-collection') .limit(1) .get() .then(query => query.size);