DocumentReference
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.
class DocumentReference<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> { }
private constructor();
get id(): string;
get path(): string;
readonly type: string;
withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): DocumentReference<NewAppModelType, NewDbModelType>;
§Type Parameters
§
AppModelType = DocumentData
[src]§
DbModelType extends DocumentData = DocumentData
[src]§Properties
§
converter: FirestoreDataConverter<AppModelType, DbModelType> | null
[src]If provided, the FirestoreDataConverter
associated with this instance.
§
path: string readonly
[src]A string representing the path of the referenced document (relative to the root of the database).
§
parent: CollectionReference<AppModelType, DbModelType> readonly
[src]The collection this DocumentReference
belongs to.
§Methods
§
withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): DocumentReference<NewAppModelType, NewDbModelType>
[src]Applies a custom data converter to this DocumentReference
, allowing you
to use your own custom model objects with Firestore. When you call {@link
@param converter
- Converts objects to and from Firestore.
@return
A DocumentReference
that uses the provided converter.
withConverter(converter: null): DocumentReference<DocumentData, DocumentData>
[src]Removes the current converter.
@param converter
null
removes the current converter.
@return
A DocumentReference<DocumentData, DocumentData>
that does not
use a converter.