Home > @firebase/firestore > lite > getDocs
getDocs() function
Executes the query and returns the results as a QuerySnapshot.
All queries are executed directly by the server, even if the the query was previously executed. Recent modifications are only reflected in the retrieved results if they have already been applied by the backend. If the client is offline, the operation fails. To see previously cached result and local modifications, use the full Firestore SDK.
Signature:
export declare function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
Parameters
Parameter | Type | Description |
---|---|---|
query | Query<T> | The Query to execute. |
Returns:
Promise<QuerySnapshot<T>>
A Promise that will be resolved with the results of the query.