Skip to content

This project provides a base repository pattern implementation for NestJS applications. It offers a reusable and consistent approach to data access, making it easier to manage database operations and business logic.

Notifications You must be signed in to change notification settings

tranduykhang1/nestjs-base-repository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goals:

  • The purpose of this package is support to define a simple CRUD Rest API quickly.

Required:

  • = @nestjs/mongoose@10.0.2

  • = mongoose@8.0.1

Supported methods:

  • create
  • findOne
  • findAll
  • paginatedAggregate
  • updateOne
  • deleteOne
  • deleteMany
  • count

Usage:

export class AppRepository extends BaseRepository<
    AppDocument,
    CreateDto,
    UpdateDto
> {
    constructor(
        @InjectModel(App.name)
        private _appModel: Model<AppDocument>
    ) {
        super(_appModel);
    }
}

About

This project provides a base repository pattern implementation for NestJS applications. It offers a reusable and consistent approach to data access, making it easier to manage database operations and business logic.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published