-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-293 Add support for a comment parameter to the aggregate command #432
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the comment
option to both the PHP docs preceding the Aggregate class and the RST documentation when you get a chance.
Rather than copy the text from Find operation's comment
option, I'd suggest using the description in the 3.6 manual:
Users can specify an arbitrary string to help trace the operation through the database profiler, currentOp, and logs.
src/Operation/Aggregate.php
Outdated
if (isset($this->options['comment'])) { | ||
$cmd['comment'] = $this->options['comment']; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since comment
and maxTimeMS
are the same in the sense that we want to check if they're isset()
and then copy them as-is into the $cmd
document, I propose creating a foreach
as we have in other command helpers:
foreach (['comment', 'maxTimeMS'] as $option) {
if (isset($this->options[$option])) {
$cmd[$option] = $this->options[$option];
}
}
allowDiskUse
is always set, so we can leave its earlier assignment as-is.
I added the |
I was referring to the doc block before
Sorry if that was unclear. |
Users can specify an arbitrary string to help trace the operation through the | ||
database profiler, currentOp, and logs. | ||
|
||
.. versionadded:: 1.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I just came across #423 while looking through closed PRs and was going to pop in to ask about this, but you beat me to it 👍
Good to squash and merge |
https://jira.mongodb.org/browse/PHPLIB-293