Skip to content

yldrmzffr/joi-oid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

joi-oid

view on npm npm module downloads licence Build Status

Joi validator with Mongo ObjectId.

Installation

npm i -s joi-oid

or

npm install joi-oid --save

use

joi-oid verifies whether the value is suitable for the Mongo ObjectId type.

It is used like Joi instead of Joi. 🤔

const Joi = require('joi-oid')

const schema = Joi.object({
  id: Joi.objectId(),
  name: Joi.string(),
  age: Joi.number().min(18),
})

License

MIT 🥰🤑

About

Joi validator with Mongo ObjectId

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published