Skip to content

Commit

Permalink
fix(populate): get doc schema using $__schema to avoid paths named …
Browse files Browse the repository at this point in the history
…`schema`

Fix #10619
  • Loading branch information
vkarpov15 committed Aug 26, 2021
1 parent 1e8c424 commit d39f25c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/helpers/populate/getModelsMapForPopulate.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = function getModelsMapForPopulate(model, docs, options) {
doc = docs[i];
let justOne = null;

const docSchema = doc != null && doc.$__ != null ? doc.schema : modelSchema;
const docSchema = doc != null && doc.$__ != null ? doc.$__schema : modelSchema;
schema = getSchemaTypes(model, docSchema, doc, options.path);

// Special case: populating a path that's a DocumentArray unless
Expand Down

0 comments on commit d39f25c

Please sign in to comment.