Tag: Nest.js

0

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

0

Add index to Schema

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

0

Transactions

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

0

Mongoose model

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

0

Docker Mongoose

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

0

DTO data verification

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

0

Modularization

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

0

Errors

Wrong choice in Nest Throwing an exception Use library-specific response objects Create interceptors and use exception filters Additionally, nest has helper methods for all common error responses,

0

Service

Create service When creating a service, first enter nest generate service, abbreviated nest g s. Enter the name after that. service is used to process logic and can be reused after being extracted.