Soft delete an entity by its ID. This operation marks the entity as deleted without permanently destroying the record.
The ID of the entity to delete. @returns- A promise that resolves to the deleted entity or null if not found.
Find an entity by its ID.
The ID of the entity to find.
Optionalfields: SelectQuery<T>[]Fields to select in the returned entity.
OptionalListQueryOptions: ListQueryOptions<T>Options for listing queries.
Find one entity matching the query.
Optionalquery: FilterQuery<T>Optionalfields: SelectQuery<T>[]OptionalListQueryOptions: ListQueryOptions<T>List entities matching the query.
Optionalquery: FilterQuery<T>The query to filter documents.
Optionalfields: SelectQuery<T>[]Fields to select in the returned entities.
OptionalListQueryOptions: ListQueryOptions<T>Options for listing queries.
Update an entity by its ID.
The ID of the entity to update.
The partial entity to update.
Optionaloptions: UpdateOptionsUpsert a single record based on certain criteria.
The return types of this method align with the MongoDB UpdateResult interface
models.baseModel.Saved<T>['_id'] if the document did not exist (an upsert took place).null if the document did exist before the upsert operation.
The name of the model.