diff --git a/lib/cast.js b/lib/cast.js index a2c9777628a..7f475edfeb4 100644 --- a/lib/cast.js +++ b/lib/cast.js @@ -255,7 +255,7 @@ module.exports = function cast(schema, obj, options, context) { } } } - } else if (val.constructor.name === 'Array' && ['Buffer', 'Array'].indexOf(schematype.instance) === -1) { + } else if (Array.isArray(val) && ['Buffer', 'Array'].indexOf(schematype.instance) === -1) { var casted = []; for (var valIndex = 0; valIndex < val.length; valIndex++) { casted.push(schematype.castForQueryWrapper({