react-query-firebase / react-native/firestore / getDocData
Function: getDocData()
ts
function getDocData<AppModelType>(options): Promise<AppModelType | null>;Defined in: react-native/firestore/utils/getDocData.ts:20
Asynchronously retrieves document data from a specified database reference. Utilizes the helper function getDocSnap to fetch the document snapshot and checks if the document exists before returning its data.
Type Parameters
AppModelType
AppModelType extends AppModel = AppModel
Parameters
options
The options for fetching document data.
db
Module
path?
string
pathSegments?
string[]
reference?
| CollectionReference<AppModelType> | DocumentReference<AppModelType>
Returns
Promise<AppModelType | null>
Returns a promise that resolves to the document data if it exists, or null if the document does not exist.