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 > / > getDocsFromCache

getDocsFromCache() function

Executes the query and returns the results as a QuerySnapshot from cache. Returns an error if the document is not currently cached.

Signature:

export declare function getDocsFromCache<T>(query: Query<T>): Promise<QuerySnapshot<T>>;

Parameters

Parameter Type Description
query Query<T>

Returns:

Promise<QuerySnapshot<T>>

A Promise that will be resolved with the results of the query.