Creates a new ToManyRelationship
Gets the ids of the relationship.
The ids are in order of insertion and is preserved in the document.
Gets the models currently in the relationship.
If
Gets the unique ids of the relationship
The ids are in order of insertion but the duplicates are removed
Adds the id of a document to the relationship
The id to add
this
Adds multiple document ids to the relationship
The ids to add
this
Adds a model to the relationship.
It adds the model's id to the list of ids tracked by the relationship. If you want to assign a model without changing the list, use assignModel
Model to add
this
Adds multiple models to the relationship
It adds the models' ids to the list of ids tracked by the relationship. If you want to assign the models without changing the list, use assignModels
Models to add
this
Assigns a model to the relationship if its id is tracked.
It only assigns a model if this model's id is already in the list of tracked ids. If you want to add the model to the tracking, use addModel
Model to assign
this
Assigns models to the relationship if their ids are tracked.
It only assigns a model if this model's id is already in the list of tracked ids. If you want to add the model to the tracking, use addModels
Models to assign
this
Erase all the relationships stored
Gets a specific loaded item by its id
Id of the item to retrieve
The model if it exists or undefined if not loaded or not in the relationship at all.
Clears the current relationship and loaded models and add the ids provided in their place
The ids to add
this
Sets the models of the relationship. The models must have an id.
It clears the relationship of any previous id tracking.
Models to set
Class holding references to multiple items of the same collection that can be loaded or not.
The ids can be duplicated but the models are unique per id to avoid unecessary calls