Skip to content

Conversation

@IslandRhythms
Copy link
Collaborator

No description provided.

@IslandRhythms IslandRhythms requested a review from vkarpov15 July 8, 2022 15:43
@IslandRhythms IslandRhythms self-assigned this Jul 8, 2022
@IslandRhythms
Copy link
Collaborator Author

IslandRhythms commented Jul 8, 2022

It's complaining about one line in model.js that

  • I did not touch
  • is the comments for the buildBultWriteOperations where the line is the indented @param

The line is 3691 if you want to take a look

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! 👍
Can you also add the option to the JSDoc and TS type definitions + TS tests?

Also, what do you think of calling it defaultLean instead of lean?

How would we go about overriding that for a specific query? I think we can .setOptions({ lean: false });, I also think it might be useful to have a .notLean() method that does the reverse of .lean().

name: 'I am a lean doc, fast and small'
});
const entry = await Test.findOne();
assert.equal(entry instanceof mongoose.Document, false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an extra check in this test that verifies you can still overwrite lean().

So const doc = await Test.findOne().lean(false); assert.ok(entry instanceof mongoose.Document)

Also, no need to do assert.equal(entry instanceof mongoose.Document, false);. Just assert.ok(!entry instanceof mongoose.Document);

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this as "Request changes" since I selected the wrong radio button previously.

@vkarpov15 vkarpov15 changed the base branch from master to 6.5 July 22, 2022 00:08
@vkarpov15 vkarpov15 merged commit 38aa931 into 6.5 Jul 22, 2022
@vkarpov15 vkarpov15 deleted the gh-10090 branch July 22, 2022 00:10
vkarpov15 added a commit that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants