<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [/](./firestore_.md) &gt; [getDocFromServer](./firestore_.getdocfromserver.md)

## getDocFromServer() function

Reads the document referred to by this `DocumentReference` from the server. Returns an error if the network is not available.

<b>Signature:</b>

```typescript
export declare function getDocFromServer<T>(reference: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  reference | [DocumentReference](./firestore_.documentreference.md)<!-- -->&lt;T&gt; |  |

<b>Returns:</b>

Promise&lt;[DocumentSnapshot](./firestore_.documentsnapshot.md)<!-- -->&lt;T&gt;&gt;

A Promise resolved with a `DocumentSnapshot` containing the current document contents.

