voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
30 lines (19 loc) • 1.69 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) > [QuerySnapshot](./firestore_lite.querysnapshot.md)
## QuerySnapshot class
A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects representing the results of a query. The documents can be accessed as an array via the `docs` property or enumerated using the `forEach` method. The number of documents can be determined via the `empty` and `size` properties.
<b>Signature:</b>
```typescript
export declare class QuerySnapshot<T = DocumentData>
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [docs](./firestore_lite.querysnapshot.docs.md) | | Array<[QueryDocumentSnapshot](./firestore_lite.querydocumentsnapshot.md)<!-- --><T>> | An array of all the documents in the <code>QuerySnapshot</code>. |
| [empty](./firestore_lite.querysnapshot.empty.md) | | boolean | True if there are no documents in the <code>QuerySnapshot</code>. |
| [query](./firestore_lite.querysnapshot.query.md) | | [Query](./firestore_lite.query.md)<!-- --><T> | The query on which you called [getDocs()](./firestore_.getdocs.md) in order to get this <code>QuerySnapshot</code>. |
| [size](./firestore_lite.querysnapshot.size.md) | | number | The number of documents in the <code>QuerySnapshot</code>. |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [forEach(callback, thisArg)](./firestore_lite.querysnapshot.foreach.md) | | Enumerates all of the documents in the <code>QuerySnapshot</code>. |