Skip to content

Commit

Permalink
refactor: couple of minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Feb 10, 2025
1 parent 32fd472 commit 5ca86a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -2361,10 +2361,10 @@ Query.prototype._find = async function _find() {

// Separate options to pass down to `completeMany()` in case we need to
// set a session on the document
const completeManyOptions = Object.assign({}, {
const completeManyOptions = {
session: this && this.options && this.options.session || null,
lean: mongooseOptions.lean || null
});
};

const options = this._optionsForExec();

Expand All @@ -2382,7 +2382,7 @@ Query.prototype._find = async function _find() {
}

if (!mongooseOptions.populate) {
const versionKey = _this.schema.options.versionKey;
const versionKey = this.schema.options.versionKey;
if (mongooseOptions.lean && mongooseOptions.lean.versionKey === false && versionKey) {
docs.forEach((doc) => {
if (versionKey in doc) {
Expand Down

0 comments on commit 5ca86a8

Please sign in to comment.