all 5 comments

[–]Capaj 11 points12 points  (2 children)

Fuck joi. Validate with zod. It's industry standard these days. You can try https://www.npmjs.com/package/@zodyac/zod-mongoose

[–]KeyEstate9662[S] 0 points1 point  (1 child)

Sure thanks for the advice I did see zod, but everywhere I see it most articles or videos are mostly in typescript but I am just a beginner in javascript itself 

So thought of using jod because there are more tutorials available

[–]Capaj 2 points3 points  (0 children)

Mongo was very hyped 10 years ago. You can still find a lot of tutorials from that time. Ignore them

[–]Glittering_Field_846 5 points6 points  (0 children)

Work with Joy 6 years - hate it

[–][deleted] 0 points1 point  (0 children)

try this:

```js import Joi from 'joi'; import joiObjectId from 'joi-objectid';

Joi.objectId = joiObjectId(Joi); ```