Skip to content

Commit

Permalink
Update populate options to apply perDocumentLimit instead of limit
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinDrost committed Nov 21, 2024
1 parent 03ffb75 commit 033fbb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/utilities/service.utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ const buildPopulateOptions = async (
path: populateOption.path,
select: populateOption.select,
match: { $and: [populateOption.match ?? {}, { $expr: $expr ?? {} }] },
perDocumentLimit: +(populateOption.limit ?? 0) || undefined,
options: {
sort: populateOption.sort,
limit: +(populateOption.limit ?? 0) || undefined,
skip: +(populateOption.skip ?? 0) || undefined,
projection: unsets?.reduce((acc, unset) => {
acc[unset] = 0;
Expand Down

0 comments on commit 033fbb4

Please sign in to comment.