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

docs(populate): added transform option description #12560

Merged
merged 1 commit into from Oct 17, 2022

Conversation

lpizzinidev
Copy link
Contributor

closes #12551

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.

Thanks 👍 I'll make a couple of changes in master but otherwise this looks good


<h3 id="transform"><a href="#transform">Manipulate populated objects</a></h3>

We can manipulate populated objects using `transform`. This option lets you register a function with two arguments: the populated document, and the original id, used to populate the document. The function will be called on every populated document and will give us more control over the result of the `populate()` execution.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor nitpick: we prefer to use 2nd person "You can manipulate populated objects" versus "We can manipulate populated objects". Also, we prefer to have 1 line per sentence. Minor issues, overall this is great.

@vkarpov15 vkarpov15 added this to the 6.6.6 milestone Oct 17, 2022
@vkarpov15 vkarpov15 merged commit bf42639 into Automattic:master Oct 17, 2022
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.

Add info on populate transform option to populate docs
2 participants