-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore(main): release 6.20.0 #4641
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
tadjik1
merged 1 commit into
main
from
release-please--branches--main--components--mongodb
Sep 18, 2025
Merged
chore(main): release 6.20.0 #4641
tadjik1
merged 1 commit into
main
from
release-please--branches--main--components--mongodb
Sep 18, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@github-actions
github-actions
bot
requested a review
from a team
as a code owner
August 29, 2025 16:29
@github-actions
github-actions
bot
force-pushed
the
release-please--branches--main--components--mongodb
branch
6 times, most recently
from
September 9, 2025 20:11
5ff9d45
to
71e2db5
Compare
@github-actions
github-actions
bot
force-pushed
the
release-please--branches--main--components--mongodb
branch
4 times, most recently
from
September 17, 2025 14:29
3b7e2bc
to
101c737
Compare
@github-actions
github-actions
bot
force-pushed
the
release-please--branches--main--components--mongodb
branch
from
September 17, 2025 15:13
101c737
to
fc9fbfd
Compare
run release_notes
1 similar comment
run release_notes
tadjik1
tadjik1
approved these changes
Sep 18, 2025
@tadjik1
tadjik1
deleted the
release-please--branches--main--components--mongodb
branch
September 18, 2025 15:27
@github-actions
github-actions
bot
added
autorelease: tagged
and removed
autorelease: pending
labels
Sep 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
🌱 A new release!
6.20.0 (2025年09月17日)
The MongoDB Node.js team is pleased to announce version 6.20.0 of the
mongodb
package!Release Notes
Collection
andDb
objects now provide references to theirDb
andMongoClient
Hint is supported with unacknowledged writes for delete, update and findAndModify commands on servers that support hint
The driver no longer throws errors when
hint
is provided to unacknowledged writes fordelete
,update
andfindAndModify
commands in the following circumstances:update
commands.delete
andfindAndModify
commands on servers >=4.4.ServerCapabilities and ReadPreference.minWireVersion are deprecated
Neither the
ServerCapabilities
class nor theReadPreference.minWireVersion
property were ever intended for public use and, internally, are effectively dead code with the driver's minimum supported server version being 4.2.Driver info and metadata MongoClient options have been deprecated.
These will be made internal in a future major release:
driverInfo
additionalDriverInfo
metadata
extendedMetadata
CommandOperationOptions.retryWrites
is deprecatedCommandOperationOptions.retryWrites
is deprecated. This per‐command option has no effect; the Node.js driver only honorsretryWrites
when configured at the client level (MongoClient options) or via the connection string. Do not use this option on individual commands. There is no runtime behavior change because it was already ignored, but it will be removed in an upcoming major release and may cause type or build errors in code that references it. To control retryable writes, setretryWrites
in MongoClient options or includeretryWrites=true|false
in the connection string.ChangeStream
.tryNext()
now updatesresumeToken
to prevent duplicates after resumeWhen
.tryNext()
returns a change document, the driver now caches itsresumeToken
, aligning its behavior with.next()
and the'change'
event. If.tryNext()
returnsnull
(no new changes), nothing is cached, which is unchanged from previous behavior.Previously,
.tryNext()
did not update theresumeToken
, so a resumable error could cause a resume from an older token and re-deliver already processed changes. With this release, resumes continue from the latest token observed via.tryNext()
, preventing duplicates.Applications that poll change streams with
.tryNext()
in non-blocking loops benefit directly. There are no API changes; if you previously tracked and passedresumeAfter
orstartAfter
manually, you can now rely on the driver’s built-in token caching.Huge thanks to @rkistner for bringing this bug to our attention and for sharing code to reproduce it. Huge thanks as well to @Omnicpie for investigating and implementing a fix.
Change Streams now resume on
MongoServerSelectionError
When the driver encounters a
MongoServerSelectionError
while processing a Change Stream (e.g., due to a transient network issue or during an election), it now treats the error as resumable and attempts to resume using the latest cached resume token.This applies to both iterator and event-emitter usage:
There are no API changes. If you previously caught
MongoServerSelectionError
and implemented manual resume logic, you can now rely on the driver’s built-in resume mechanism, which uses the cached resume token from the change event’s_id
to continue without losing events.Huge thanks to @grossbart for bringing this bug to our attention, investigating it and for sharing code to reproduce it!
MongoClient.appendMetadata()
ignores duplicate metadataMongoClient.appendMetadata()
will no longer append metadata, if the metadata is a duplicate of metadata already appended to the MongoClient.Features
retryWrites
inCommandOperationOptions
(#4661) (620972d)Bug Fixes
resumeToken
inChangeStream.tryNext()
(#4636) (8331a93)Documentation
We invite you to try the
mongodb
library immediately, and report any issues to the NODE project.