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

getDocFromCache() function

Reads the document referred to by this DocumentReference from cache. Returns an error if the document is not currently cached.

Signature:

export declare function getDocFromCache<T>(reference: DocumentReference<T>): Promise<DocumentSnapshot<T>>;

Parameters

Parameter Type Description
reference DocumentReference<T>

Returns:

Promise<DocumentSnapshot<T>>

A Promise resolved with a DocumentSnapshot containing the current document contents.