Skip to content

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

Merged
merged 3 commits into from
Nov 14, 2017

Conversation

kvwalker
Copy link
Contributor

Copy link
Member

@jmikola jmikola left a 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.

if (isset($this->options['comment'])) {
$cmd['comment'] = $this->options['comment'];
}

Copy link
Member

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.

@kvwalker
Copy link
Contributor Author

I added the comment option to the RST documentation, but what are the PHP docs preceding the Aggregate class?

@jmikola
Copy link
Member

jmikola commented Nov 14, 2017

what are the PHP docs preceding the Aggregate class?

I was referring to the doc block before class Aggregate:

* Supported options:

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
Copy link
Member

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 👍

@jmikola
Copy link
Member

jmikola commented Nov 14, 2017

Good to squash and merge :shipit:

@kvwalker kvwalker merged commit dcd6e84 into mongodb:master Nov 14, 2017
@kvwalker kvwalker deleted the PHPLIB-293 branch November 14, 2017 17:18
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.

2 participants