Skip to content

react-query-firebase / getDocRef

Function: getDocRef() ​

ts
function getDocRef<AppModelType>(options): DocumentReference<AppModelType, AppModelType> | null;

Defined in: src/web/firestore/utils/getDocRef.ts:24

Retrieves a document reference based on provided database options. Either reference or path.

Type Parameters ​

AppModelType ​

AppModelType extends AppModel = AppModel

Parameters ​

options ​

The options for building doc reference.

db ​

Firestore

path? ​

string

pathSegments? ​

string[]

reference? ​

| CollectionReference<AppModelType, AppModelType> | DocumentReference<AppModelType, AppModelType>

Returns ​

DocumentReference<AppModelType, AppModelType> | null

Returns a document reference

Released under the MIT License.