Skip to content

Conversation

durran
Copy link
Member

@durran durran commented Jul 13, 2025

Description

The driver will no longer throw an error if aggregate is used with explain and write concern. The server simply ignores the write concern in this case.

What is changing?

  • Removes the check and throw from the aggregation operation.
  • Adds a unit test to protect from regressions.
Is there new documentation needed for these changes?

None

What is the motivation for this change?

NODE-4184

Release Highlight

Explain + Write Concern on an aggregation no longer throws.

The server will silently ignore the write concern.

// Previously this would throw a MongoInvalidArgumentError, now it will return explain results.
collection.aggregate([{ $match: { n: 1 }}], { writeConcern: { w: 1 }, explain: 'verbose' });

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@durran durran closed this Jul 13, 2025
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.

1 participant