Home > @firebase/firestore > / > collectionGroup
collectionGroup() function
Creates and returns a new Query
instance that includes all documents in the database that are contained in a collection or subcollection with the given collectionId
.
Signature:
export declare function collectionGroup(firestore: FirebaseFirestore, collectionId: string): Query<DocumentData>;
Parameters
Parameter | Type | Description |
---|---|---|
firestore | FirebaseFirestore | A reference to the root Firestore instance. |
collectionId | string | Identifies the collections to query over. Every collection or subcollection with this ID as the last segment of its path will be included. Cannot contain a slash. |
Returns:
The created Query
.