Skip to content

Commit

Permalink
fix(populate): handle options.perDocumentLimit option same as `perD…
Browse files Browse the repository at this point in the history
…ocumentLimit` when calling `populate()`

Fix #9418
  • Loading branch information
vkarpov15 committed Sep 17, 2020
1 parent 7a86066 commit 014af7d
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 @@ -299,7 +299,7 @@ module.exports = function getModelsMapForPopulate(model, docs, options) {
ids = flat.filter((val, i) => modelNames[i] === modelName);
}

if (!available[modelName] || currentOptions.perDocumentLimit != null) {
if (!available[modelName] || currentOptions.perDocumentLimit != null || get(currentOptions, 'options.perDocumentLimit') != null) {
currentOptions = {
model: Model
};
Expand Down

0 comments on commit 014af7d

Please sign in to comment.