veritatisdoloremque
Version:
Monorepo for the Firebase JavaScript SDK
29 lines (16 loc) • 1.32 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [DocumentReference](./firestore_lite.documentreference.md) > [withConverter](./firestore_lite.documentreference.withconverter.md)
## DocumentReference.withConverter() method
Applies a custom data converter to this `DocumentReference`<!-- -->, allowing you to use your own custom model objects with Firestore. When you call , [getDoc()](./firestore_.getdoc.md)<!-- -->, etc. with the returned `DocumentReference` instance, the provided converter will convert between Firestore data and your custom type `U`<!-- -->.
Passing in `null` as the converter parameter removes the current converter.
<b>Signature:</b>
```typescript
withConverter(converter: null): DocumentReference<DocumentData>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| converter | null | Converts objects to and from Firestore. Passing in <code>null</code> removes the current converter. |
<b>Returns:</b>
[DocumentReference](./firestore_lite.documentreference.md)<!-- --><[DocumentData](./firestore_lite.documentdata.md)<!-- -->>
A `DocumentReference<U>` that uses the provided converter.