Comparing version 6.13.4 to 6.13.5
@@ -246,3 +246,3 @@ 'use strict'; | ||
const userSpecifiedTransform = typeof populateOptions.transform === 'function'; | ||
const transform = userSpecifiedTransform ? populateOptions.transform : noop; | ||
const transform = userSpecifiedTransform ? populateOptions.transform : v => v; | ||
if (Array.isArray(val)) { | ||
@@ -339,5 +339,1 @@ // find logic | ||
} | ||
function noop(v) { | ||
return v; | ||
} |
@@ -185,2 +185,11 @@ 'use strict'; | ||
} | ||
if (Array.isArray(match)) { | ||
for (const item of match) { | ||
if (item != null && item.$where) { | ||
throw new MongooseError('Cannot use $where filter with populate() match'); | ||
} | ||
} | ||
} else if (match != null && match.$where != null) { | ||
throw new MongooseError('Cannot use $where filter with populate() match'); | ||
} | ||
data.match = match; | ||
@@ -464,2 +473,12 @@ data.hasMatchFunction = hasMatchFunction; | ||
if (Array.isArray(match)) { | ||
for (const item of match) { | ||
if (item != null && item.$where) { | ||
throw new MongooseError('Cannot use $where filter with populate() match'); | ||
} | ||
} | ||
} else if (match != null && match.$where != null) { | ||
throw new MongooseError('Cannot use $where filter with populate() match'); | ||
} | ||
// Get local fields | ||
@@ -466,0 +485,0 @@ const ret = _getLocalFieldValues(doc, localField, model, options, virtual); |
{ | ||
"name": "mongoose", | ||
"description": "Mongoose MongoDB ODM", | ||
"version": "6.13.4", | ||
"version": "6.13.5", | ||
"author": "Guillermo Rauch <guillermo@learnboost.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2301314
49688