A CollectionReference object can be used for adding documents, getting document references, and querying for documents (using the methods inherited from Query).

Type parameters

Index

Constructors

Private constructor

Properties

firestore

firestore: Firestore

The Firestore for the Firestore database (useful for performing transactions, etc.).

id

id: string

The collection's identifier.

parent

A reference to the containing DocumentReference if this is a subcollection. If this isn't a subcollection, the reference is null.

path

path: string

A string representing the path of the referenced collection (relative to the root of the database).

Methods

add

doc

endAt

endBefore

get

isEqual

limit

limitToLast

onSnapshot

orderBy

startAfter

startAt

where

withConverter

  • withConverter ( converter null ) : CollectionReference < DocumentData >
  • Applies a custom data converter to this CollectionReference, allowing you to use your own custom model objects with Firestore. When you call add() on the returned CollectionReference 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.

    Parameters

    Returns CollectionReference<DocumentData>

    A CollectionReference that uses the provided converter.
  • withConverter < U > ( converter FirestoreDataConverter < U > ) : CollectionReference < U >
  • Applies a custom data converter to this CollectionReference, allowing you to use your own custom model objects with Firestore. When you call add() on the returned CollectionReference 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.

    Type parameters

    Parameters

    Returns CollectionReference<U>

    A CollectionReference that uses the provided converter.