voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
27 lines (15 loc) • 915 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [/](./firestore_.md) > [getDocFromCache](./firestore_.getdocfromcache.md)
## getDocFromCache() function
Reads the document referred to by this `DocumentReference` from cache. Returns an error if the document is not currently cached.
<b>Signature:</b>
```typescript
export declare function getDocFromCache<T>(reference: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| reference | [DocumentReference](./firestore_.documentreference.md)<!-- --><T> | |
<b>Returns:</b>
Promise<[DocumentSnapshot](./firestore_.documentsnapshot.md)<!-- --><T>>
A Promise resolved with a `DocumentSnapshot` containing the current document contents.