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.