Skip to content

PHPLIB-477: Deprecate CodeWScope for use within the mapReduce command #690

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 1 commit into from
Oct 30, 2019

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Oct 29, 2019

https://jira.mongodb.org/browse/PHPLIB-477

Contrary to the original wording suggestion, I replaced the usage of "CodeWScope" for "Javascript instance with a scope". I don't think users will be familiar with the internal nomenclature of BSON types, so this may be more understandable to the average user.

Apart from deprecating these in the documentation, we also emit an E_USER_DEPRECATED PHP error that can be logged with libraries like symfony/phpunit-bridge.

@alcaeus alcaeus requested a review from jmikola October 29, 2019 15:35
@alcaeus alcaeus self-assigned this Oct 29, 2019
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.

Typo fix and formatting suggestion. LGTM otherwise.

.. note::

Passing a Javascript instance with a scope is deprecated. Put all scope
variables in the "scope" option of the MapReduce operation.
Copy link
Member

Choose a reason for hiding this comment

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

I think our convention for referring to options uses monospace formatting instead of quotes, so we should write scope here. Feel free to double-check, though.

This made we wonder if the scope option for mapReduce was being preserved with the aggregation changes. According to the design document linked from PM-766, it will remain available.

Copy link
Member Author

Choose a reason for hiding this comment

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

Monospace formatting is the way to go in the rest of the docs, so I've adjusted it.

The deprecation message was suggested in the DRIVERS ticket, along with the "CodeWScope" wording which I decided to drop. This is why I assumed that the scope option would remain available. Thanks for confirming this.

}

if ($reduce->getScope() !== null) {
@trigger_error('Use of Javascript with scope in "$map" argument for MapReduce is deprecated. Put all scope variables in the "scope" option of the MapReduce operation.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

"$reduce" argument

Copy link
Member Author

Choose a reason for hiding this comment

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

🤦‍♂️

alcaeus added a commit that referenced this pull request Oct 30, 2019
@alcaeus alcaeus merged commit a5e7454 into mongodb:master Oct 30, 2019
@alcaeus alcaeus deleted the phplib-477 branch October 30, 2019 07:16
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