Creates a new entity from the given data. Internally this uses insert.
The create data.
Optional
options: CreateOptionsAdditional options, like a transaction etc.
The newly created entity.
Creates all entities from the provided data array.
An array of create data, which each creates a new entity.
Optional
options: CreateAllOptionsAdditional options, eg. A transaction.
All newly created entities.
Deletes all entities that match the provided where filter.
The where filter to find the entities that should be deleted.
Optional
options: DeleteAllOptions<T>Additional options, like a transaction.
An array of all the updated entities.
Deletes an entity with the provided id.
The id of the entity to deleted.
Optional
options: BaseRepositoryOptionsAdditional options, like a transaction.
Finds all entities with the given options.
Optional
options: FindAllOptions<T>The options, including the where filter etc.
An array of found entities.
Finds all entities with the given options, in paginated form.
The page for which the entities should be found.
The limit of entities to receive for that page.
Optional
options: FindAllPaginatedOptions<T>Additional options including where filter etc.
A paginated result of the found entities.
Finds an entity by the given id.
The id of the entity to find.
Optional
options: FindByIdOptions<T>Additional options, eg. Transaction.
The found entity.
Finds a single entity with the given options.
The options, including the where filter etc.
Whether or not a result is required. Defaults to true.
The found result. If required is set to false, also undefined.
Resets the changes of a single change set on the given entity to the state before the change set. This DOES preserve any changes that happened after the change set. The given change set gets deleted afterwards.
The entity that should be reset.
The id of the changeSet to reset.
Whether or not a change set should be created.
Whether or not create change sets should be preserved. In that case the entity gets reset to the state after the create change set. Also, the change set isn't deleted.
Optional
options: BaseRepositoryOptionsAdditional options, eg. Transaction.
The updated entity.
Resets the changes of a single change set on the entity with the given id to the state before the oldest change set. This DOES preserve any changes that happened after the change set. The given change set gets deleted afterwards.
The id of the entity that should be reset.
The id of the changeSet to reset.
Whether or not a change set should be created.
Whether or not create change sets should be preserved. In that case the entity gets reset to the state after the create change set. Also, the create change set isn't deleted.
Optional
options: BaseRepositoryOptionsAdditional options, eg. Transaction.
The updated entity.
Rolls back all changes on the entities found with the given where filter to the state of the given date. This DOES NOT preserve any changes that happened after the date. Any change sets after the given date will be deleted in the end.
The date to which the rollback should happen.
Optional
where: Where<T>A filter to only rollback some entities.
Whether or not a change set should be created.
Whether or not create change sets should be preserved. In that case the entity gets reset to the state after the create change set. Also, the create change set isn't deleted.
Optional
options: BaseRepositoryOptionsAdditional options, eg. Transaction.
The updated entity.
Rolls back all changes on the given entity that have happened since the given change set. This DOES NOT preserve any changes that happened after the change set. The given change set and any change sets after that will be deleted in the end. Calls rollbackByDate on the change set date internally.
The entity to rollback.
The id of the changeSet to rollback to.
Whether or not a change set should be created.
Whether or not create change sets should be preserved. In that case the entity gets reset to the state after the create change set. Also, the create change set isn't deleted.
Optional
options: BaseRepositoryOptionsAdditional options, eg. Transaction.
The updated entity.
Rolls back all changes on the entity with the given id that have happened since the given change set. This DOES NOT preserve any changes that happened after the change set. The given change set and any change sets after that will be deleted in the end. Calls rollbackByDate on the change set date internally.
The id of the entity to rollback.
The id of the changeSet to rollback to.
Whether or not a change set should be created.
Whether or not create change sets should be preserved. In that case the entity gets reset to the state after the create change set. Also, the create change set isn't deleted.
Optional
options: BaseRepositoryOptionsAdditional options, eg. Transaction.
The updated entity.
Rolls back all changes on the given entity that have happened since the given date. This DOES NOT preserve any changes that happened after the date. Any change sets after the given date will be deleted in the end.
The entity to rollback.
The date to which the rollback should happen.
Whether or not a change set should be created.
Whether or not create change sets should be preserved. In that case the entity gets reset to the state after the create change set. Also, the create change set isn't deleted.
Optional
options: BaseRepositoryOptionsAdditional options, eg. Transaction.
The updated entity.
Rolls back all changes on the entity with the given id that have happened since the given date. This DOES NOT preserve any changes that happened after the date. Any change sets after the given date will be deleted in the end.
The id of the entity to rollback.
The date to which the rollback should happen.
Whether or not a change set should be created.
Whether or not create change sets should be preserved. In that case the entity gets reset to the state after the create change set. Also, the create change set isn't deleted.
Optional
options: BaseRepositoryOptionsAdditional options, eg. Transaction.
The updated entity.
Updates all entities that match the provided where filter.
The where filter to find the entities that should be updated.
The data to update the entities with.
Optional
options: UpdateAllOptionsAdditional options, like a transaction.
An array of all the updated entities.
Updates all entities that match the provided where filter.
The where filter to find the entities that should be updated.
The data to update the entities with.
Optional
options: UpdateAllOptionsAdditional options, like a transaction.
An array of all the updated entities.
Updates an entity with the provided id.
The id of the entity to update.
The data to update the entity with.
Optional
options: UpdateByIdOptionsAdditional options, like a transaction.
The updated entity.
Update an entity by id with property/value pairs in the data object.
Value for the entity id.
Data attributes to be updated.
Optional
options: UpdateByIdOptionsOptions for the operations.
A promise that will be resolve if the operation succeeded or will be rejected if the entity was not found.
A base repository that automatically handles creation of change sets.