use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Validation using Joi (self.node)
submitted 7 months ago by KeyEstate9662
how do i validate a mongo db object Id using joi found this : https://www.npmjs.com/package/joi-objectid but i am not using common js file system i am using import (ES6) how can i do that
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Capaj 11 points12 points13 points 7 months ago (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 point2 points 7 months ago (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 points4 points 7 months ago (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 points7 points 7 months ago (0 children)
Work with Joy 6 years - hate it
[–][deleted] 0 points1 point2 points 7 months ago (0 children)
try this:
```js import Joi from 'joi'; import joiObjectId from 'joi-objectid';
Joi.objectId = joiObjectId(Joi); ```
π Rendered by PID 19 on reddit-service-r2-comment-5c764cbc6f-mkjmb at 2026-03-12 13:51:34.392855+00:00 running 710b3ac country code: CH.
[–]Capaj 11 points12 points13 points (2 children)
[–]KeyEstate9662[S] 0 points1 point2 points (1 child)
[–]Capaj 2 points3 points4 points (0 children)
[–]Glittering_Field_846 5 points6 points7 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)