voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
28 lines (16 loc) • 1.17 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [collectionGroup](./firestore_lite.collectiongroup.md)
## 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`<!-- -->.
<b>Signature:</b>
```typescript
export declare function collectionGroup(firestore: FirebaseFirestore, collectionId: string): Query<DocumentData>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| firestore | [FirebaseFirestore](./firestore_lite.firebasefirestore.md) | 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. |
<b>Returns:</b>
[Query](./firestore_lite.query.md)<!-- --><[DocumentData](./firestore_lite.documentdata.md)<!-- -->>
The created `Query`<!-- -->.