1.1.2 • Published 4 years ago

joi-oid v1.1.2

Weekly downloads
221
License
MIT
Repository
github
Last release
4 years ago

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 🥰🤑