Update Node_modules
This commit is contained in:
+7
-2
@@ -90,6 +90,11 @@ module.exports = function assignVals(o) {
|
||||
const parts = o.path.split('.');
|
||||
let cur = docs[i];
|
||||
for (let j = 0; j < parts.length - 1; ++j) {
|
||||
// If we get to an array with a dotted path, like `arr.foo`, don't set
|
||||
// `foo` on the array.
|
||||
if (Array.isArray(cur) && !utils.isArrayIndex(parts[j])) {
|
||||
break;
|
||||
}
|
||||
if (cur[parts[j]] == null) {
|
||||
cur[parts[j]] = {};
|
||||
}
|
||||
@@ -190,7 +195,7 @@ function valueFilter(val, assignmentOpts, populateOptions) {
|
||||
|
||||
function maybeRemoveId(subdoc, assignmentOpts) {
|
||||
if (assignmentOpts.excludeId) {
|
||||
if (typeof subdoc.setValue === 'function') {
|
||||
if (typeof subdoc.$__setValue === 'function') {
|
||||
delete subdoc._doc._id;
|
||||
} else {
|
||||
delete subdoc._id;
|
||||
@@ -212,4 +217,4 @@ function isPopulatedObject(obj) {
|
||||
obj.$isMongooseMap ||
|
||||
obj.$__ != null ||
|
||||
leanPopulateMap.has(obj);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -9,6 +9,8 @@ const get = require('../get');
|
||||
const leanPopulateMap = require('./leanPopulateMap');
|
||||
const mpath = require('mpath');
|
||||
|
||||
const populateModelSymbol = require('../symbols').populateModelSymbol;
|
||||
|
||||
/*!
|
||||
* @param {Schema} schema
|
||||
* @param {Object} doc POJO
|
||||
@@ -138,18 +140,18 @@ module.exports = function getSchemaTypes(schema, doc, path) {
|
||||
|
||||
const fullPath = nestedPath.concat([trypath]).join('.');
|
||||
if (topLevelDoc.$__ && topLevelDoc.populated(fullPath) && p < parts.length) {
|
||||
const schema = get(doc.$__.populated[fullPath], 'options.model.schema');
|
||||
if (schema != null) {
|
||||
const model = doc.$__.populated[fullPath].options[populateModelSymbol];
|
||||
if (model != null) {
|
||||
const ret = search(
|
||||
parts.slice(p),
|
||||
schema,
|
||||
model.schema,
|
||||
subdoc ? mpath.get(trypath, subdoc) : null,
|
||||
nestedPath.concat(parts.slice(0, p))
|
||||
);
|
||||
|
||||
if (ret) {
|
||||
ret.$isUnderneathDocArray = ret.$isUnderneathDocArray ||
|
||||
!schema.$isSingleNested;
|
||||
!model.schema.$isSingleNested;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user