Skip to content

Complex custom validation DTO with MongoDb integration using NestJs. Imlementation new ValidatorConstraint that can validate data based on array of mongoose ObjectID or new document object (which properties also should be validated based on another DTO).

License

Notifications You must be signed in to change notification settings

merteldem1r/nestjs-custom-validation-dto

Repository files navigation

Complex Custom Validation in NestJS with MongoDB | Is Exists Or New

Custom Validation in NestJS with MongoDB

Medium Article

My article on Medium. In this piece, I explain custom validation using NestJS and how to integrate it with a database. While working with the NestJS framework, I encountered a challenge: validating requests for an array that could either contain new document objects (which I also validate based on another DTO) or existing MongoDB ObjectIDs. After some research and practice, I think that I found an effective solution for that case.

Custom Validation in NestJS with MongoDB

About

Complex custom validation DTO with MongoDb integration using NestJs. Imlementation new ValidatorConstraint that can validate data based on array of mongoose ObjectID or new document object (which properties also should be validated based on another DTO).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published