joi objectid you must pass joi as an argument code example
Example: joi object id validation
npm i joi-objectid
const Joi = require('joi');
Joi.objectId = require('joi-objectid')(Joi)
// now you can use Joi.objectId to validate the post request sent by user