Firestore: Does querying a collection also includes their sub collection?

Firestore queries are shallow, meaning they only return the documents that are at the level you are querying for and they do not return their subcollections.

If you want to get the subcollections as well, you need to do a separate query for that.


Unlike in Firebase realtime database where to display a list of users you would have been downloaded the entire User object together with all children that exist within that object, in Cloud Firestore this is not an issue anymore. So if you have subcollections within a document, you will not download them.

Queries in Firestore are shallow: they only get items from the collection that the query is run against. There is no way to get documents from a top-level collection and other collections or subcollections in a single query. So don't worry about those subcollections.