Creates a new SingleDocumentRepository on a model
Type on which the repository operates
The instance of firestore this repository connects to
Optionalparents: CollectionDocumentTuplesThe optional parent collections for repositories of subcollections
Id of the document
Protected ReadonlyfirestoreInstance of firestore this repository uses to reach the DB
Protected OptionalparentsGets the path to the collection of this repository
ProtectedcollectionGets a collection reference to the collection of this repository
Collection ref to this repository
Gets the blueprint for a document built with the type of this repository
Whether or not this repository is a subcollection or not
ProtectedstorageThe storage of metadatas of this repository
ProtectedtypeThe metadatas corresponding to the type of this repository
ProtectedtypeGets the name of the type.
Converts multiple documents to their corresponding model
Documents to convert
The converted models
Converts a document to a model (if the id is not in the document, it is lost in the process)
Document to convert
The converted model
Check if the document exists in the database
If you need to use the document later in the process, getAsync is a better fit
ProtectedfirestoreProtectedgetGets a reference to the document corresponding to this id.
Id for which you want a document ref
A document ref corresponding to the model
Gets a reference to the document corresponding to this model.
If the model doesn't have any id, it will give you a reference to a new document, generate an id and assign it to the model
Model for which you want a document ref
A document ref corresponding to the model
Gets a reference to the document corresponding to this model.
Id or model for which you want a document ref
A document ref corresponding to the model
ProtectedgetGets a document reference for each of the models provided.
Ids for which you want document refs
A document ref for each of the models provided in the same order
Gets a document reference for each of the models provided.
Models for which you want document refs
A document ref for each of the models provided in the same order
Gets a document reference for each of the models provided.
Ids or models for which you want document refs
A document ref for each of the models provided in the same order
Creates a repository using a generator function
Type of the repository
Type of the model
Generator function of the repository
Type of the model
Listens to the changes of the document
An observable on the document's changes
Converts multiple models to their corresponding document
Models to convert
The converted documents
Converts a partial model to a document
Model to convert
The converted document
Builds the path to a document
Model or id for which you want the Firestore's DB path
ProtectedrunRuns a tansaction on the transaction function provided
Operations to do durring the transaction
Optionaloptions: TransactionOptionsTransaction options
ProtectedtoConverts a firestORM query to a firestore query
Query to convert
The firestorm query
Modifies the item in the database.
The id, if provided, is ignored in the model and set to this.documentId
It will fail if the document doesn't exist.
Partial or full model to update. It must have an id.
A Promise that resolved when the item has been updated
Repository with a basic CRUD implemention for collections of one named document.