voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
32 lines (21 loc) • 2.25 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)
## DocumentReference class
A `DocumentReference` refers to a document location in a Firestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist.
<b>Signature:</b>
```typescript
export declare class DocumentReference<T = DocumentData>
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [firestore](./firestore_lite.documentreference.firestore.md) | | [FirebaseFirestore](./firestore_lite.firebasefirestore.md) | The [FirebaseFirestore](./firestore_.firebasefirestore.md) the document is in. This is useful for performing transactions, for example. |
| [id](./firestore_lite.documentreference.id.md) | | string | The document's identifier within its collection. |
| [parent](./firestore_lite.documentreference.parent.md) | | [CollectionReference](./firestore_lite.collectionreference.md)<!-- --><T> | The collection this <code>DocumentReference</code> belongs to. |
| [path](./firestore_lite.documentreference.path.md) | | string | A string representing the path of the referenced document (relative to the root of the database). |
| [type](./firestore_lite.documentreference.type.md) | | (not declared) | The type of this Firestore reference. |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [withConverter(converter)](./firestore_lite.documentreference.withconverter.md) | | Applies a custom data converter to this <code>DocumentReference</code>, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.setdoc.md)<!-- -->, [getDoc()](./firestore_lite.getdoc.md)<!-- -->, etc. with the returned <code>DocumentReference</code> instance, the provided converter will convert between Firestore data and your custom type <code>U</code>. |
| [withConverter(converter)](./firestore_lite.documentreference.withconverter_1.md) | | Removes the current converter. |