joi-mongodb-objectid
v0.1.0
Published
Joi extension to validate MongoDB ObjectId.
Downloads
103
Maintainers
Readme
joi-mongodb-objectid
Joi extension to validate MongoDB ObjectId.
Installation
npm install joi-mongodb-objectid --save
Usage
const { ObjectId } = require('bson')
const JoiBase = require('joi')
const JoiObjectId = require('joi-mongodb-objectid')
const Joi = JoiBase.extend(JoiObjectId)
const result = Joi.objectId().validate(ObjectId())