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.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
merteldem1r/nestjs-custom-validation-dto
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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 0
No packages published
