Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Document#populate documentation, tests #10728

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

saveman71
Copy link
Contributor

When migrating to mongoose 6 I found that the new populate syntax for Document#populate was missing some documentation and it was hard to migrate without having a look at the code and guessing that the syntax was the same as Query#populate.

I'm not so familiar with documentation, but I copied the one from Query#populate which seems like an improvement.

Maybe a "sub-page" could describe what arguments Query#populate, Model#populateandDocument#populate` accept in a single place instead of maintaining that in 3 different places, but I'll leave that up to you.

Also added a few tests to demonstrate the arguments I was adding do work.

@saveman71
Copy link
Contributor Author

Also, for these 3 documentation, I guess it's missing options.populate to do nested population?

@vkarpov15
Copy link
Collaborator

@saveman71 that's correct, options.populate is the option for nested populate.

@vkarpov15 vkarpov15 added this to the 6.0.6 milestone Sep 15, 2021
@vkarpov15 vkarpov15 merged commit 8bc8f5b into Automattic:master Sep 15, 2021
@vkarpov15 vkarpov15 added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Sep 15, 2021
@saveman71 saveman71 deleted the better-document-populate-doc branch September 15, 2021 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants