Skip to content

react-query-firebase / react-native/firestore / getDocSnap

Function: getDocSnap()

ts
function getDocSnap<AppModelType>(options): Promise<null | DocumentSnapshot<AppModelType>>;

Defined in: react-native/firestore/utils/getDocSnap.ts:21

Asynchronously retrieves a document snapshot from Firestore using a specified document reference or path information. This function handles getting the appropriate document reference based on the parameters provided, and then fetches the document data from Firestore.

Type Parameters

AppModelType

AppModelType extends AppModel = AppModel

Parameters

options

The options for retrieving the document snapshot

db

Module

path?

string

pathSegments?

string[]

reference?

| CollectionReference<AppModelType> | DocumentReference<AppModelType>

Returns

Promise<null | DocumentSnapshot<AppModelType>>

Returns a document reference

Released under the MIT License.