joi-oid

1.1.2 • Public • Published

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

/joi-oid/

    Package Sidebar

    Install

    npm i joi-oid

    Weekly Downloads

    775

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    4.18 kB

    Total Files

    6

    Last publish

    Collaborators

    • yldrmzffr