-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(NODE-4924)!: remove mapReduce collection helper #3511
feat(NODE-4924)!: remove mapReduce collection helper #3511
Conversation
9c2179b
to
09f2f4e
Compare
src/utils.ts
Outdated
(options.out.inline === 1 || options.out === 'inline') | ||
) { | ||
return true; | ||
} |
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.
Is it okay to remove this here? If I follow the code correctly, this method is called for all commands, including client.db().command()
, so this change would also affect users who run mapReduce
through that instead of the helper (and since the migration notes mention this as an alternative for cases in which users can’t use agg pipelines, that seems to be a supported use case).
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.
I think this is a judgement call. Do you have an opinion?
When a user manually constructs the command, they can attach their own read concern. I think it's reasonable to say that because we're dropping support for mapReduce
, that means we drop support for attaching readConcern
s automatically when executing a runCommand.
Alternatively, we could continue to support automatically attaching the read concern to mapReduce
commands. One argument in favor of this approach is that the Db.command()
options does take a read concern, so users may assume that the read concern they supply as a part of the options object would get attached to their command.
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.
the
Db.command()
options does take a read concern, so users may assume that the read concern they supply as a part of the options object would get attached to their command.
I don’t have a strong opinion, but this seems like a reasonable expectation to me, esp. if this works for other commands.
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.
I think it's reasonable to to keep it in until the driver's minimum supported server version has completely removed the command.
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.
Just a note as well because it seemed a bit unclear here. This is only determining if the command supports read concern - it still must be explicitly provided. This change would have just ignored the provided one in the inlined mapReduce
case.
2e91324
to
fabf2e5
Compare
@baileympearson README changes LGTM |
fabf2e5
to
0c6e5b5
Compare
test/integration/client-side-encryption/client_side_encryption.spec.test.ts
Show resolved
Hide resolved
const options = { session: maybeSession(operation, context) }; | ||
if (args.out) options.out = args.out; | ||
return collection.mapReduce(map, reduce, options); | ||
throw new Error( |
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.
The mapReduce retryable-reads tests are somehow skipping so this error didn't make those tests fail, I'm not seeing it in the filter in retryable_reads.spec.test.js
, any ideas?
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.
Yeah, this threw me for a loop initially too. The filter
argument in generateTopologyTests
returns true for tests that run, false otherwise. The filter
for the retryable reads spec test is actually an inclusion filter, not exclusion.
I added the doc comment to generateTopologyTests
after getting confused by that initially.
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.
I considered a minor refactor but decided not to:
generateTopologyTests(testSuites, testContext, spec => {
const testsToRun = [
... list all test regexes here
];
return testsToRun.some(regex => spec.description.match(regex));
});
want me to make the change?
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.
Your call, I'm happy that we looked into it and know why they weren't run
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.
CI issues, I think something caused by the merge, import related
9cd3ec8
to
db7bc78
Compare
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>
This is a non-breaking change that adds support for the new [`mongodb@5`][1] driver. Note that any consumers who use the new driver will lose access to `$mapReduce`, since this was [removed upstream][2]. We keep this functionality for the older drivers. [1]: https://github.com/mongodb/node-mongodb-native/releases/tag/v5.0.0 [2]: mongodb/node-mongodb-native#3511
This is a non-breaking change that adds support for the new [`mongodb@5`][1] driver. Note that any consumers who use the new driver will lose access to `$mapReduce`, since this was [removed upstream][2]. We keep this functionality for the older drivers. [1]: https://github.com/mongodb/node-mongodb-native/releases/tag/v5.0.0 [2]: mongodb/node-mongodb-native#3511
This is a non-breaking change that adds support for the new [`mongodb@5`][1] driver. Note that any consumers who use the new driver will lose access to `$mapReduce`, since this was [removed upstream][2]. We keep this functionality for the older drivers. [1]: https://github.com/mongodb/node-mongodb-native/releases/tag/v5.0.0 [2]: mongodb/node-mongodb-native#3511
Description
What is changing?
Collection.mapReduce
is removed.Is there new documentation needed for these changes?
Nope.
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript