@aequum/mongoose
v0.27.15
Published
aequum mongoose tools for repository, pagination, CRUD/CRUDL, configs and utils
Maintainers
Readme
aequum Mongoose tools
A collection of tools which includes:
- Repositories
- Pagination via
mongoose-paginate-v2 - CRUD/CRUDL services via
@aequum/crudl - Schemas with virtual ID
idfield instead_id - Duplicate exception handling via
@aequum/exceptions
Components
Repositories
MongooseRepository: Repository base class for Mongoose, providing basic CRUDL operations.MongoosePaginatedRepositoryExtends fromMongooseRepositoryto provide pagination support.
Services:
BaseCRUDLMongooseService: Base CRUDL service implementation for Mongoose (*).BaseCRUDLMongoosePaginatedService: Extends fromBaseCRUDLMongooseServiceto provide pagination support (*).
Utils:
duplicateEntryExceptionOrError: Check if the provided error is a duplicate entry error and return aDuplicateEntryException(**) or returns the original error.isDuplicateError: Check if the provided error is a Mongoose duplicate entry error.schemaTransformsForVirtualID: Apply transforms to input and ouput the virtualidfrom MongoDB_idfield.SchemaWithVirtualID: A Class that extends MongooseSchemato include a virtualidfield instead of normal_idfield.
(*) See @aequum/crudl for more information about CRUDL services.
(**): See @aequum/exceptions for more information about exceptions.
