Tech
The Repository Pattern in NestJS: a collection that happens to live in a database
The canonical starting point for a NestJS module backed by TypeORM is the one the framework itself documents: the module declares TypeOrmModule.forFeature([Order]) and the service receives the repository by injection.
@ Injectable ()
export class OrderService {
constructor (
@ InjectRepository ( Order ) private readonly repo : Repository < Order > ,
) {}
}
From there the service has find , findOne , save and delete a...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to