The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/firestore > lite > QuerySnapshot > forEach

QuerySnapshot.forEach() method

Enumerates all of the documents in the QuerySnapshot.

Signature:

forEach(callback: (result: QueryDocumentSnapshot<T>) => void, thisArg?: unknown): void;

Parameters

Parameter Type Description
callback (result: QueryDocumentSnapshot<T>) => void A callback to be called with a QueryDocumentSnapshot for each document in the snapshot.
thisArg unknown The this binding for the callback.

Returns:

void