Skip to content

react-query-firebase / web/firestore / getDocRef

Function: getDocRef()

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

Defined in: 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

null | DocumentReference<AppModelType, AppModelType>

Returns a document reference

Released under the MIT License.