trying to validate that an array has zero or more strings in one case and that it has zero or more objects in another , struggling with Joi docs :(
validate: {
you can try this:
function(data) { const Schema = { categories: Joi.array().items(Joi.string()), variables: Joi.array().items(Joi.object().keys().min(1)) } return Joi.validate(data, Schema) }
for more details checkout this repo: https://github.com/raysk4ever/nodejs_withMongoRefArray