Skip to content

Commit

Permalink
feat: support for leanWithVirtuals option to work with mongoose-lean-…
Browse files Browse the repository at this point in the history
…virtuals plugin
  • Loading branch information
nexus-aissam committed Jan 5, 2025
1 parent 2f81e46 commit 4d65add
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ function paginate(query, options, callback) {
mQuery.sort(sort);

if (lean) {
mQuery.lean(lean);

// use whit mongoose-lean-virtuals
if (leanWithVirtuals) {
mQuery.lean({ virtuals: leanWithVirtuals });
} else {
mQuery.lean(lean);
}
}

Expand Down

0 comments on commit 4d65add

Please sign in to comment.