voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
32 lines (21 loc) • 2.11 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) > [CollectionReference](./firestore_lite.collectionreference.md)
## CollectionReference class
A `CollectionReference` object can be used for adding documents, getting document references, and querying for documents (using [query()](./firestore_.query.md)<!-- -->).
<b>Signature:</b>
```typescript
export declare class CollectionReference<T = DocumentData> extends Query<T>
```
<b>Extends:</b> [Query](./firestore_lite.query.md)<!-- --><T>
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [id](./firestore_lite.collectionreference.id.md) | | string | The collection's identifier. |
| [parent](./firestore_lite.collectionreference.parent.md) | | [DocumentReference](./firestore_lite.documentreference.md)<!-- --><[DocumentData](./firestore_lite.documentdata.md)<!-- -->> \| null | A reference to the containing <code>DocumentReference</code> if this is a subcollection. If this isn't a subcollection, the reference is null. |
| [path](./firestore_lite.collectionreference.path.md) | | string | A string representing the path of the referenced collection (relative to the root of the database). |
| [type](./firestore_lite.collectionreference.type.md) | | (not declared) | The type of this Firestore reference. |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [withConverter(converter)](./firestore_lite.collectionreference.withconverter.md) | | Applies a custom data converter to this CollectionReference, allowing you to use your own custom model objects with Firestore. When you call [addDoc()](./firestore_.adddoc.md) with the returned <code>CollectionReference</code> instance, the provided converter will convert between Firestore data and your custom type <code>U</code>. |
| [withConverter(converter)](./firestore_lite.collectionreference.withconverter_1.md) | | Removes the current converter. |