chore(main): release 5.7.0 [skip-ci] #3735
Merged
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.
🌱 A new release!
5.7.0 (2023-07-06)
The MongoDB Node.js team is pleased to announce version 5.7.0 of the
mongodb
package!Release Notes
Write Concern legacy options deprecated
wtimeout
,j
, andfsync
options have been deprecated, please usewtimeoutMS
andjournal
instead.Legacy SSL options deprecated
In an effort to simplify TLS setup and use with the driver we're paring down the number of custom options to the ones that are common to all drivers. This should reduce inadvertent misconfiguration due to conflicting options.
The legacy "ssl-" options have been deprecated, each has a corresponding "tls-" option listed in the table below (except for
sslCRL
, you may directly use the Node.jscrl
option instead).tlsCertificateFile
has also been deprecated, please usetlsCertificateKeyFile
or pass thecert
directly to the MongoClient constructor.In addition to the common driver options, the Node.js driver also passes through Node.js TLS options provided on the MongoClient to Node.js' tls.connect API, which may be convenient to reuse with other Node.js APIs.
ca
tlsCAFile
sslCA
string
crl
sslCRL
string
cert
tlsCertificateKeyFile
sslCert
string
key
tlsCertificateKeyFile
sslKey
string
passphrase
tlsCertificateKeyFilePassword
sslPass
string
rejectUnauthorized
tlsAllowInvalidCertificates
sslValidate
boolean
New
includeResultMetadata
option forfindOneAnd...
family of methods.This option defaults to
true
, which will return aModifyResult
type. When set tofalse
, which willbecome the default in the next major release, it will return the modified document or
null
if nothing matched.This applies to
findOneAndDelete
,findOneAndUpdate
,findOneAndReplace
.Support for change stream split events
When change stream documents exceed the max BSON size limit of 16MB, they can be split into multiple fragments in order to not error when sending events over the wire. In order to enable this functionality, the collection must be created with
changeStreamPreAndPostImages
enabled and the change stream itself must include an$changeStreamSplitLargeEvent
aggregation stage. This feature requires a minimum server version of 7.0.0.Example:
Programmatic management of search indexes
This PR adds support for managing search indexes (creating, updating, deleting and listing indexes). The new methods are available on the
Collection
class.BSON updated to v5.4.0
Take a look at the
bson
package's release notes!Snappy loaded lazily
Unlike our other compression mechanisms snappy was loaded at the module level, meaning it would be optionally imported whether or not the driver was configured to use snappy compression. Snappy is now aligned with our other optional peer dependencies and is only loaded when enabled.
Zstd and Kerberos are now optional peer dependencies
This allows users who do not use these features to not have them installed. Users who do use these feature will now have them lazy loaded upon first use.
listDatabases
nameOnly
option bug fixThe
listDatabases
API exposes thenameOnly
option which allows you to limit its output to only the names of the databases on a given mongoDB deployment:Prior to this fix, the option was not being set properly on the command, so the output was always given in full.
Thanks to @redixhumayun for submitting this fix!
saslprep
"is not a function" fix for bundled deploymentssaslprep
is an optional dependency used to perform Stringprep Profile for User Names and Passwords for SCRAM-SHA-256 authentication. Thesaslprep
library breaks when it is bundled, causing the driver to throwTypeError
s.This release includes a fix that prevents the driver throwing
TypeError
s when attempting to usesaslprep
in bundled environments.Cursor.map transform bug fixes
The cursor API provides the ability to apply a
map
function to each document in the cursor:Cursor iteration properly catches errors thrown from the transform applied in
Cursor.map
Starting in version 4.0 of the driver, if the transform function throws an error, there are certain scenarios where the driver does not correctly catch this error and an uncaught exception is thrown:
This release adds logic to ensure that whenever we transform a cursor document, we handle any errors properly. Any errors thrown from a transform function are caught and returned to the user.
Cursor.hasNext no longer transforms documents if a transform has been applied to the cursor
Version 4.0 introduced a bug that would apply a
transform
function to documents in the cursor when the cursor was iterated usingCursor.hasNext()
. When combined withCursor.next()
, this would result in transforming documents multiple times.This release removes the transform logic from
Cursor.hasNext
, preventing cursor documents from being transformed twice when iterated usinghasNext
.Features
Bug Fixes
Documentation
We invite you to try the
mongodb
library immediately, and report any issues to the NODE project.