Skip to content

Commit

Permalink
fix(populate): handle virtual justOne correctly if it isn't set
Browse files Browse the repository at this point in the history
Fix #6988
  • Loading branch information
vkarpov15 committed Sep 13, 2018
1 parent 0bff408 commit dcfb894
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/model.js
Expand Up @@ -3937,7 +3937,7 @@ function getModelsMapForPopulate(model, docs, options) {
} else {
normalizedRef = virtual.options.ref;
}
justOne = virtual.options.justOne;
justOne = !!virtual.options.justOne;
isVirtual = true;
if (!modelNames) {
modelNames = [].concat(normalizedRef);
Expand Down
2 changes: 1 addition & 1 deletion lib/virtualtype.js
Expand Up @@ -23,7 +23,7 @@ function VirtualType(options, name) {
this.path = name;
this.getters = [];
this.setters = [];
this.options = options || {};
this.options = Object.assign({}, options);
}

/**
Expand Down

0 comments on commit dcfb894

Please sign in to comment.