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

getDocFromServer() function

Reads the document referred to by this DocumentReference from the server. Returns an error if the network is not available.

Signature:

export declare function getDocFromServer<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.