<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [lite](./firestore_lite.md) &gt; [QuerySnapshot](./firestore_lite.querysnapshot.md) &gt; [forEach](./firestore_lite.querysnapshot.foreach.md)

## QuerySnapshot.forEach() method

Enumerates all of the documents in the `QuerySnapshot`<!-- -->.

<b>Signature:</b>

```typescript
forEach(callback: (result: QueryDocumentSnapshot<T>) => void, thisArg?: unknown): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  callback | (result: [QueryDocumentSnapshot](./firestore_lite.querydocumentsnapshot.md)<!-- -->&lt;T&gt;) =&gt; void | A callback to be called with a <code>QueryDocumentSnapshot</code> for each document in the snapshot. |
|  thisArg | unknown | The <code>this</code> binding for the callback. |

<b>Returns:</b>

void

