Database migration
Database Migration Database migrations provide a way to incrementally update the database schema and keep it in sync with the application data model, while preserving the existing data in our databa
Derek Zhu
Database Migration Database migrations provide a way to incrementally update the database schema and keep it in sync with the application data model, while preserving the existing data in our databa
index Indexes are special lookup tables that database search engines can use to speed up data retrieval. Without an index, Mongo must perform a collection scan, which means it must scan every docume
Transaction We perform multiple operations on the database, making sure they only happen if everything is successful. A database transaction represents a unit of work performed in a database managem
Inject model into service Use the @injectModel() decorator and pass in the schema name. Model<schema class name> is a fixed notation. Same here as express, but also write async/await to m
Data model schema These models are responsible for creating, reading and deleting documents from the Mongo database. We need to create a schema first. The schema can be created manually using NestJS
Docker containerization The benefits of using Docker: flexible, lightweight, portable, loosely coupled. They can be built locally to the cloud and run anywhere, and finally containers are loosely co
DTO DTO is short for data transfer object. A DTO is an object that encapsulates data and sends it from one application to another. DTOs help us define interfaces or inputs and outputs within the sys
Reasonable nest architecture, create modules A well-structured architecture should employ multiple modules, each encapsulating a set of closely related functions. The function should contain control