NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #3169 most downloaded on npm
The official MongoDB driver for Node.js
Latest stable
7.9.0
Last release 3 days ago
16 Nov 2026
Ships on a steady schedule
a new release about every 8 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
968 releases · first in 2011
Drag across the ruler to compare, or tap a release to open it.
This beta release addresses a few bugs relating to using CSFLE with the beta version of the driver. As well as a fix for BulkWriteResult and BulkWrite
This beta release addresses a few bugs relating to using CSFLE with the beta version of the driver. As well as a fix for BulkWriteResult and BulkWriteError to correctly reflect the operation's result information.
You can take a look at the raw updates list in our HISTORY.md file, we are intending to do a complete rundown of features and fixes with the v4.0.0 release.
You can give it a try with:
npm install mongodb@beta
If you have any suggestions about clarifying documentation or if you run into any issues or have any feature ideas please let us know! You can make an account and submit tickets to our JIRA project here.
Reference: https://docs.mongodb.com/drivers/node API: https://mongodb.github.io/node-mongodb-native/4.0 Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.0/HISTORY.md
The MongoDB Node.js team is pleased to announce a beta version v4.0.0-beta.0 of the driver.
The MongoDB Node.js team is pleased to announce a beta version v4.0.0-beta.0 of the driver.
A major motivation for releasing this beta was the migration of the entire code base to TypeScript. While we took special care to ensure a smooth transition, we imagine such a dramatic change might reveal unexpected issues. This beta release makes it easy to easily check compatibility with your application and make use of the included type definitions.
Additionally, we are publishing an early version of the new API documentation https://mongodb.github.io/node-mongodb-native/4.0.
You can take a look at the raw updates list in our HISTORY.md file, we are intending to do a complete rundown of features and fixes with the v4.0.0 release.
You can give it a try with:
npm install mongodb@beta
If you have any suggestions about clarifying documentation or if you run into any issues or have any feature ideas please let us know! You can make an account and submit tickets to our JIRA project here.
Reference: https://docs.mongodb.com/drivers/node API: https://mongodb.github.io/node-mongodb-native/4.0 Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.0/HISTORY.md
Your coding agent can read these notes before it upgrades. Set up the MCP server →
The MongoDB Node.js team is pleased to announce version 3.7.4 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.7.4 of the mongodb package!
This release fixes a bug that throws a type error when SCRAM-SHA-256 is used with saslprep in a webpacked environment.
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.7.3 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.7.3 of the mongodb package!
Full Changelog: https://github.com/mongodb/node-mongodb-native/compare/v3.7.2...v3.7.3
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.7.2 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.7.2 of the mongodb package!
This release contains a fix for optional require of dependencies on yarn berry.
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.7.1 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.7.1 of the mongodb package!
This release contains an internal improvement that makes our monitor utilize the new hello handshake for monitoring when available.
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The deprecationErrors option can be used to enable command failures when using functionality that is deprecated from version 1. Note that at the time…
The MongoDB Node.js team is pleased to announce version 3.7.0 of the mongodb package!
Versioned API is a new feature in MongoDB 5.0 that allows user-selectable API versions, subsets of MongoDB server semantics, to be declared on a client. During communication with a server, clients with a declared API version will force the server to behave in a manner compatible with the API version. Declaring an API version on a client can be used to ensure consistent responses from a server, providing long term API stability for an application. The declared API version is applied to all commands run through the client, including those sent through the generic RunCommand helper. Specifying versioned API options in the command document AND declaring an API version on the client is not supported and will lead to undefined behavior.
// Declare API version "1" for the client
client = new MongoClient(uri, { serverApi: { version: '1' } });
cursor = client.db('database').collection('coll').find(...);
Declaring a strict API version will cause the MongoDB server to reject all commands that are not part of the declared API version. This includes command options and aggregation pipeline stages. For example, the following find call would fail because the tailable option is not part of version 1:
// Declare API version "1" for the client, with strict on
client = new MongoClient(uri, { serverApi: { version: '1', strict: true } });
// Fails with an error
cursor = client.db('database').collection('coll').find({ ... }, { tailable: true });
The deprecationErrors option can be used to enable command failures when using functionality that is deprecated from version 1. Note that at the time of this writing, no deprecations in version 1 exist.
// Declare API version "1" for the client, with deprecationErrors on
client = new MongoClient(uri, { serverApi: { version: '1', deprecationErrors: true } });
// Note: since API version "1" is the initial version, there are no deprecated commands to provide as an example yet.
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.6.12 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.6.12 of the mongodb package!
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.6.11 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.6.11 of the mongodb package!
This patch addresses a few bugs listed below. Notably, we fixed an issue with the way we imported one of our optional dependencies that blocked webpack bundling.
If you are a webpack user you will still get warnings for our optional dependencies (if you don't use them). You can hush the warnings by adding this option to your webpack config:
{
// ...
externals: [
'mongodb-client-encryption',
'aws4',
'saslprep',
'kerberos',
'snappy',
'bson-ext',
],
// ...
}
It is important to note that this will leave the imports in place and not pull in the code to your bundle. If you later do adopt using these dependencies you'll want to revert the relevant setting.
We invite you to try the mongodb package immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.6.10 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.6.10 of the mongodb package!
This patch addresses a few bugs listed below. Notably the bsonRegExp option is now respected by the underlying BSON library, you can use this to decode regular expressions that contain syntax not permitted in native JS RegExp objects. Take a look at this example:
await collection.insertOne({ a: new BSONRegExp('(?-i)AA_') })
await collection.findOne({ a: new BSONRegExp('(?-i)AA_') }, { bsonRegExp: true })
// { _id: ObjectId, a: BSONRegExp { pattern: '(?-i)AA_', options: '' } }
Also there was an issue with Cursor.forEach where user defined forEach callbacks that throw errors incorrectly handled catching errors. Take a look at the comments in this example:
collection.find({}).forEach(doc => {
if(doc.bad) throw new Error('bad document!');
}).catch(error => {
// now this is called! and error is `bad document!`
})
// before this fix the `bad document!` error would be thrown synchronously
// and have to be caught with try catch out here
We invite you to try the mongodb package immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.6.9 of the driver!
The MongoDB Node.js team is pleased to announce version 3.6.9 of the driver!
This release fixes a major performance bug in bulk write operations, which was inadvertently introduced by an incomplete code change in the previous release. The bug resulted in redundant array iterations and caused exponential increases in bulk operation completion times. Thank you Jan Schwalbe for bringing this to our attention!
We invite you to try the mongodb package immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.6.8 of the mongodb package!
The MongoDB Node.js team is pleased to announce version 3.6.8 of the mongodb package!
Thanks to the quick adoption of the previous new patch by the mongoose package (https://github.com/Automattic/mongoose/pull/10265) a small bug was identified when connections to mongodb would timeout causing unnecessary clean up operations to run. Thank you @vkarpov15!
We invite you to try the mongodb package immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 3.6.7 of the driver
The MongoDB Node.js team is pleased to announce version 3.6.7 of the driver
This patch addresses a number of bug fixes. Notably, there was an interesting javascript related issue with sorting documents. It only impacts users using numerical keys in their documents.
> { a: 'asc', [23]: 'asc' }
{ [23]: 'asc', a: 'asc' } // numbers come first
In javascript, numerical keys are always iterated first when looping over the keys of an object followed by the chronological specification of each string key. This effectively changes the ordering of a sort document sent to mongodb. However our driver does accept sort specification in a variety of ways and one way to avoid this problem is passing an array of tuples:
[['a', 'asc'], ['23', 'asc']]
This ensures that mongodb is sent the 'a' key as the first sort key and '23' as the second.
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
The MongoDB Node.js team is pleased to announce version 3.6.6 of the driver
The MongoDB Node.js team is pleased to announce version 3.6.6 of the driver
This patch addresses a number of bugs listed below.
Most notably, for client side encryption users upgrading to this version of the driver along with the new version of mongodb-client-encryption@1.2.3 will alleviate the potential deadlock case if your connection pool was fully utilized. There will now be an internal MongoClient that will be used for metadata look ups (e.g, listCollections) when the pool size is under certain constraints. The events generated from this client are forwarded to the client instance you initialize so it is possible to monitor all events.
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
[NODE-3114] - Incorrect warning: Top-level use of w, wtimeout, j, and fsync is deprecated
The MongoDB Node.js team is pleased to announce version 3.6.5 of the driver!
In this patch there is a fix surrounding an issue some users were encountering in serverless environments when using the Unified Topology. If the nodejs process went unused for a great amount of time there was an intermittent issue that would cause startSession to fail, however, issuing a dummy read request would resolve the problem. The session support check is now done after server selection meaning the driver has the most up to date information about the MongoDB deployment before utilizing sessions. We encourage any user's that implemented workarounds to updated their driver and make use of this fix.
In addition, the previous release of our driver added a warning about an upcoming change in the v4 version of the driver about how users can specify their write concern options. We've updated the driver to use nodejs's process.emitWarning API in nearly all cases where the driver prints something out, as well as limit most warning messages to only be printed once.
[NODE-1726] - Deprecate Topology events in Db
The MongoDB Node.js team is pleased to announce version 3.6.4 of the driver
The full set of $explain verbosity settings are now supported:
queryPlannerqueryPlannerExtendedexecutionStatsallPlansExecutionIn the following commands:
aggregate() (MDB 3.0+)find() (MDB 3.0+)remove() (MDB 3.0+)update() (MDB 3.0+)distinct() (MDB 3.2+)findAndModify() (MDB 3.2+)mapReduce() (MDB 4.4+)You can get a lot of insight into the performance of a query or optimization using these fine grained reports. To learn more about how to use explain read here.
We removed automatic direct connection for the unified topology in the 3.6.3 release of the driver. This change was preparatory for the 4.0 version of the driver, where we'll always perform automatic discovery. To avoid making this kind of change in a patch release, this version restores automatic direct connection when connecting to a single host using the unified topology without a specified replicaSet and without directConnection: false, in line with previous 3.6 releases.
NOTE: In the next major version the
unifiedTopologyis the only Topology and it is required to either specify areplicaSetname or enabledirectConnectionin order to connect to single nodes in a replica set.
There are no functional changes to the driver to support using Azure and GCP keystores but a new mongodb-client-encryption release (v1.2.0) can be found here which prominently features support for these key stores.
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
Db[ NODE-2834 ] - Remove deprecation of AggregationCursor#geoNear
The MongoDB Node.js team is pleased to announce version 3.6.3 of the driver
MongoError: not master when running createIndexA regression introduced in v3.6.2 meant that createIndex operations would not be executed with a fixed
primary read preference. This resulted in the driver selecting any server for the operation, which would
fail if a non-primary was selected.
The driver periodically monitors members of the replicaset for changes in the topology, but ensures that
the "monitoring thread" is never woken sooner than 500ms. Measuring this elapsed time depends on a
stable clock, which is not available to us in some virtualized environments like AWS Lambda. The result
was that periodically operations would think there were no available servers, and the driver would force
a wait of heartbeatFrequencyMS (10s by default) before reaching out to servers again for a new
monitoring check. The internal async interval timer has been improved to account for these environments
A regression introduced in v3.6.0 forced the driver to reuse a single kerberos client for all
authentication attempts. This would result in incomplete authentication flows, and occaisionally even
a crash in the kerberos module. The driver has been reverted to creating a kerberos client per
authentication attempt.
setImmediateA change introduced in v3.6.1 switched all our usage of process.nextTick in the connection pool with
setImmediate per Node.js core recommendation. This was observed to introduce noticeable latency when the event loop
was experiencing pressure, so the change was reverted for this release pending further investigation.
package.json for stricter package managers (pnpm, yarn2)Reference: http://mongodb.github.io/node-mongodb-native/3.6/ API: http://mongodb.github.io/node-mongodb-native/3.6/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.6/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h2> Bug </h2> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2172'>NODE-2172</a>] - Change stream breaks on disconnection when there's something piped into it. </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2784'>NODE-2784</a>] - MongoError: Not Master when running createIndex in 3.6.0 </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2807'>NODE-2807</a>] - MongoClient.readPreference always returns primary </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2827'>NODE-2827</a>] - Connecting to single mongos makes driver think it is connected to a standalone </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2829'>NODE-2829</a>] - MongoDB Driver 3.6+ Performance issues on AWS Lambda </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2835'>NODE-2835</a>] - Remove default timeout for read operations </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2859'>NODE-2859</a>] - GSSAPI AuthProvider causing crashes in Compass </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2861'>NODE-2861</a>] - Performance Regression for usage of mongodb connections (queries, inserts, ...) </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2865'>NODE-2865</a>] - Connections can be leaked if wait queue members are cancelled </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2869'>NODE-2869</a>] - Invalid assignment of X509 username makes authentication impossible </li> </ul>
<h2> Improvement </h2> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2834'>NODE-2834</a>] - Remove deprecation of AggregationCursor#geoNear </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2867'>NODE-2867</a>] - Use peerDependenciesMeta field to mark peer optional dependencies </li> </ul>
[ NODE-2798 ] - Update version of dependency "bl" due to vulnerability
The MongoDB Node.js team is pleased to announce version 3.6.2 of the driver
bl dependency due to CVE-2020-8244See this link for more details: https://github.com/advisories/GHSA-pp7h-53gx-mx7r
The logic for processing the wait queue in our connection pool ran the risk of
starving the event loop. Calls to process the wait queue are now wrapped in a
setImmediate to prevent starvation
Reference: http://mongodb.github.io/node-mongodb-native/3.6/ API: http://mongodb.github.io/node-mongodb-native/3.6/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.6/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2798'>NODE-2798</a>] - Update version of dependency "bl" due to vulnerability </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2803'>NODE-2803</a>] - Connection pool wait queue processing is too greedy </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.6.1 of the driver
The MongoDB Node.js team is pleased to announce version 3.6.1 of the driver
A bug in introducing the new CMAP Connection prevented some users from properly authenticating with the kerberos module.
createIndexThe logic for building the createIndex command was changed in v3.6.0 to use an allowlist rather than a blocklist, but omitted a number of index types in that list. This release reintroduces all supported index types to the allowlist.
createCollectionSince v3.6.0 createCollection will no longer returned a cached Collection instance if a collection already exists in the database, rather it will return a server error stating that the collection already exists. This is the same behavior provided by the strict option for createCollection, so that option has been removed from documentation.
Reference: http://mongodb.github.io/node-mongodb-native/3.6/ API: http://mongodb.github.io/node-mongodb-native/3.6/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.6/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2731'>NODE-2731</a>] - CMAP Connection type does not provide host/port properties </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2755'>NODE-2755</a>] - "language_override" option support for text index is broken </li> </ul>
<h2> Improvement
</h2>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2730'>NODE-2730</a>] - Move MongoAuthProcess into the driver source tree
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2746'>NODE-2746</a>] - Strict mode for createCollection should be removed
</li>
</ul>
[ NODE-2546 ] - Deprecate geoHaystack and geoSearch
The MongoDB Node.js team is pleased to announce version 3.6.0 of the driver
NOTE: This version begins our official support for MongoDB 4.4
MongoDB drivers maintain a local view of the topology they are connected to, and ensure the accuracy of that view by polling connected nodes on average every ~10s. In MongoDB 4.4, drivers are now able to receive push notifications about topology updates, effectively reducing the time for client recovery in failover scenarios to the time it takes for the server to make the election and report the outcome.
This feature is enabled by default when connecting to MongoDB 4.4, no changes are needed for user code.
The MONGODB-AWS authentication mechanism uses your Amazon Web Services Identity and Access Management (AWS IAM) credentials to authenticate users on MongoDB 4.4+. Please read more about this new authentication mechanism in our documentation.
There were two projects to transparently improve performance of authentication in MongoDB 4.4:
A driver can now include the first saslStart command in its initial handshake with server. This so-called "speculative authentication" allows us to reduce one roundtrip to the server for authentication a connection. This feature is only support for X.509, SCRAM-SHA-1 and SCRAM-SHA-256 (default) authentication mechanisms.
The SCRAM conversation between driver and server can now skip one of it's empty exchanges which also serves to reduce the roundtrips during a SCRAM authentication.
Db.prototype.createCollectionThe createCollection helper used to internally run a listCollections command in order to see if a collection already existed before running the command. If it determined a collection with the same name existed, it would skip running the command and return an instance of Collection. This behavior was changed in v3.6.0 to avoid potentially serious bugs, specifically that the driver was not considering options passed into createCollection as part of the collection equality check. Imagine the following scenario:
const client = new MongoClient('...');
await client.connect();
await client.db('foo').collection('bar').insert({ importantField: 'llamas' });
await client.db('foo').createCollection('bar', {
validator: { $jsonSchema: {
bsonType: 'object',
required: ['importantField'],
properties: { name: { bsonType: 'boolean' } }
}
});
The createCollection call which defines a JSON schema validator would be completely bypassed because of the existence of bar, which was implicitly created in the first command. Our policy is strictly adhere to semver, but in rare cases like this where we feel there is potential for a data corrupting bug, we make breaking behavioral changes to protect the user.
Reference: http://mongodb.github.io/node-mongodb-native/3.6/ API: http://mongodb.github.io/node-mongodb-native/3.6/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.6/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h3> Epic </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2450'>NODE-2450</a>] - Node MongoDB 4.4 Support </li> </ul>
<h3> New Feature </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2434'>NODE-2434</a>] - Reduce Client Time To Recovery On Topology Changes </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2288'>NODE-2288</a>] - MONGODB-AWS Support </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2289'>NODE-2289</a>] - Support for allowDiskUse on find operations </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2290'>NODE-2290</a>] - Allow passing hint to findAndModify update and replace operations </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2291'>NODE-2291</a>] - Improve testing around default writeConcern </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2295'>NODE-2295</a>] - Collection and index creation in multi-doc txns </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2427'>NODE-2427</a>] - OCSP Support </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2487'>NODE-2487</a>] - Support speculative authentication attempts in isMaster </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2301'>NODE-2301</a>] - Support shorter SCRAM conversation </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2269'>NODE-2269</a>] - Add support for validate command "background" option </li> </ul>
<h3> Improvement </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2175'>NODE-2175</a>] - Avoid using readConcern snapshot in sharded transaction tests </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2176'>NODE-2176</a>] - Resync bson-corpus array.json to fix duplicate test names </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2393'>NODE-2393</a>] - Change uri_options/auth-options spec test to enable conditional tests </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2394'>NODE-2394</a>] - Verify max set version and max election id on topologies in SDAM spec tests </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2422'>NODE-2422</a>] - Validate that mongocryptd is not spawned if bypassAutoEncryption=true </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2430'>NODE-2430</a>] - Raise error if hint specified for unacknowledged update using OP_MSG or OP_UPDATE </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2431'>NODE-2431</a>] - Reduce floating point precision required of extended json implementations </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2432'>NODE-2432</a>] - Clarify behavior when "me" field doesn't match any values in "hosts" array </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2477'>NODE-2477</a>] - Allow hinting the delete command </li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2504'>NODE-2504</a>] - Add SDAM test for incompatible server becoming compatible </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2506'>NODE-2506</a>] - Ensure that the WriteConcernError "errInfo" object is propagated </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2538'>NODE-2538</a>] - Add RetryableWriteError error labels to retryable transaction tests </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2546'>NODE-2546</a>] - Deprecate geoHaystack and geoSearch </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2559'>NODE-2559</a>] - Reduce race conditions in SDAM error handling </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2560'>NODE-2560</a>] - Make 'reIndex' a standalone-only command </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2564'>NODE-2564</a>] - Clarify how a driver must handle wrong set name in single topology </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2569'>NODE-2569</a>] - 'CommitQuorum' option support for 'createIndexes’ command on MongoDB 4.4 </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2576'>NODE-2576</a>] - Raise error when hint option is provided on unacknowledged writes against any server version </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2592'>NODE-2592</a>] - Update documentation for Text Search </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2594'>NODE-2594</a>] - Do not add the RetryableWriteError label to errors that occur during a write within a transaction (excepting commitTransaction and abortTransaction) </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2622'>NODE-2622</a>] - allowDiskUse option for find should be documented as only being supported in 4.4+ </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2627'>NODE-2627</a>] - Reduce default keepalive time to align with Azure defaults </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2659'>NODE-2659</a>] - Drivers should retry replSetStepDown after "Unable to acquire X lock" error </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2661'>NODE-2661</a>] - Define behavior of connectTimeoutMS=0 with streaming protocol </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2675'>NODE-2675</a>] - Test that ElectionInProgress is not resumed </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2682'>NODE-2682</a>] - Treat CursorNotFound as a resumable change stream error </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2150'>NODE-2150</a>] - Bump wire protocol version for 4.4 </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2379'>NODE-2379</a>] - Expand use of error labels for RetryableWrites </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2423'>NODE-2423</a>] - Deprecate oplogReplay find command option from CRUD spec </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2426'>NODE-2426</a>] - Make ExceededTimeLimit retryable writes error </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2429'>NODE-2429</a>] - GridFS index checking should support indexes created in the shell </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2433'>NODE-2433</a>] - Lift restriction on authSource without credentials </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2452'>NODE-2452</a>] - Unify behavior around configuration for replica set discovery </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2510'>NODE-2510</a>] - Driver support for server Hedged Reads </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2516'>NODE-2516</a>] - Update comment in Transactions withTxn examples for the manual. </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2557'>NODE-2557</a>] - Remove replicaset from tests that perform reIndex command </li> </ul>
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2416'>NODE-2416</a>] - Confusing documentation for collection.aggregate collation option </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2502'>NODE-2502</a>] - replaceOne example in test/examples/update_documents.js incorrect </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2537'>NODE-2537</a>] - createCollection helper should not run listIndexes outside of strict mode </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2567'>NODE-2567</a>] - Fix qs dependency for older node </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2616'>NODE-2616</a>] - SDAM test typo "compatible" </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2623'>NODE-2623</a>] - Gridfs doesn't allow to catch exception with length that exceeds file size </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2660'>NODE-2660</a>] - Throw an error if bulk update documents don't contain update operator expressions </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2711'>NODE-2711</a>] - Monitoring should not be immediately scheduled on streaming failure </li> </ul>
Nothing published for this version
[ NODE-2798 ] - Update version of dependency "bl" due to vulnerability
The MongoDB Node.js team is pleased to announce version 3.5.11 of the driver
A bug in introducing the new CMAP Connection prevented some users from properly
authenticating with the kerberos module.
bl dependency due to CVE-2020-8244See this link for more details: https://github.com/advisories/GHSA-pp7h-53gx-mx7r
Reference: http://mongodb.github.io/node-mongodb-native/3.5/ API: http://mongodb.github.io/node-mongodb-native/3.5/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.5/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2731'>NODE-2731</a>] - CMAP Connection type does not provide host/port properties </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2798'>NODE-2798</a>] - Update version of dependency "bl" due to vulnerability </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.10 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.10 of the driver
NOTE: This will be the final release in the 3.5.x branch, please consider upgrading to 3.6.0
@adrian-gierakowski helped us identify a bug with our ChangeStreamCursor, specifically when the cursor
was complete it would not return a valid document but instead a null value.
The server selection specification indicates that the "runCommand" helper should act
as a read operation for the purposes of server selection, and that it should use a default read
preference of "primary" which can only be overridden by the helper itself. The driver had a bug
where it would inherit the read preference from its "parent" type (Collection, Db, MongoClient)
which is at odds with the specified behavior.
mongodb+srv invalid IPv6 supportDue to a bug in how we referred to ipv6 addresses internal to the driver, if a mongodb+srv
connection string was provided with an ipv6 address the driver would never be able to connect
and would result in a the following error RangeError: Maximum call stack size exceeded.
maxStalenessSeconds not accepted when provided via optionsThere was a bug in our connection string and MongoClient options parsing where a value provided
for maxStalenessSeconds would not end up being reflected in the ReadPreference used internal
to the driver.
MongoDB can provide no guarantees around unacknowledged writes when used within a session. The
driver will now silently remove the lsid field from all writes issued with { w: 0 }, and
will return an error in these situations in the upcoming 4.0 major release.
Reference: http://mongodb.github.io/node-mongodb-native/3.5/ API: http://mongodb.github.io/node-mongodb-native/3.5/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.5/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2626'>NODE-2626</a>] - initialising change stream results in: TypeError: Cannot read property 'documents' of null </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2649'>NODE-2649</a>] - Driver 3.5.x with useUnifiedTopology sends admin commands to secondary </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2671'>NODE-2671</a>] - ipv6 is not supported when using dns service discovering </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2678'>NODE-2678</a>] - ReadPreference.fromOptions doesn't pull "maxStalenessSeconds" from options </li> </ul>
<h3> Improvement </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1341'>NODE-1341</a>] - Prohibit using unacknowledged writes with explicit sessions </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.9 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.9 of the driver
The default roundTripTime of a ServerDescription is -1, which means if that value is used we can potentially calculate a negative roundTripTime. Instead, if no previous roundTripTime exists, we use the duration of the initial handshake.
A number of new options were added when the CMAP compliant connection pool was introduced in 3.5.x. Unfortunately, these options were not documented properly. Now they are mentioned in the MongoClient documentation, with a notice that they are only supported with the unified topology.
A fix in 3.5.8 which ensured proper filtering of servers during server selection exposed an issue in max staleness calculations when the topology type is ReplicaSetNoPrimary and no servers are currently known. In order to estimate an upper bound of max staleness when there is no primary, the most stale known server is known to compare the others to - if there are no known servers, you can't reduce the array!
In certain very high load fail-over scenarios the driver is unable to reschedule a monitoring check in order to update its view of the topology for retryability. This would result in a high number of failed operations, as they were unable to determine a new viable server.
Reference: http://mongodb.github.io/node-mongodb-native/3.5/ API: http://mongodb.github.io/node-mongodb-native/3.5/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.5/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2637'>NODE-2637</a>] - connection pool options support for MongoClient </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2641'>NODE-2641</a>] - maxStalenessReducer fails on empty set of servers </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2643'>NODE-2643</a>] - Server monitoring is prevented under heavy request load </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2652'>NODE-2652</a>] - Use duration of initial handshake if no roundTripTime value exists for server </li> </ul>
<h3> Improvement </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2651'>NODE-2651</a>] - Use consistent means of measuring time </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.8 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.8 of the driver
@adityapatadia helped uncover an issue with our server selection logic which filtered out servers after evaluating whether they were in the latency window. This meant that non-viable servers were considered during the window calculation and would render certain viable servers unviable.
writeErrors property@vkarpov15 submitted a patch to always include writeErrors on a BulkWriteError.
We have logic to set the message of BulkWriteError to the message of the first
error encountered if there is only one error. Unfortunately, this logic removed
the writeErrors field when doing that, so users could be faced with an error
which conditionally changed shape.
@dead-horse identified a memory leak in the new connection pool where wait queue members which timed out might be left in the queue indefinitely under sufficient load. The fix here was to ensure that all wait queue members are flushed during wait queue processing before evaluating whether there were available sockets to process new requests.
Once @dead-horse was able to patch the connection pool memory leak, they also identified a edge case where implicit sessions could be leaked in a very specific error condition. The logic to release implicit sessions was simplified, preventing this from happening in the future
A bug introduced last summer prevented unordered bulk write operations from continuing after the first write error - one of the most important features of being an unordered operation. We now properly support this feature again.
journal in connection string is ignored@nknighter filed a report that the journal option was ignored when provided
via the connection string. The paramater j was supported both through the
connection string and explicit added to MongoClient options, but the official
documentation for connection strings support a journal option.
Reference: http://mongodb.github.io/node-mongodb-native/3.5/ API: http://mongodb.github.io/node-mongodb-native/3.5/api/ Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.5/HISTORY.md
We invite you to try the driver immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2407'>NODE-2407</a>] - UnifiedTopology + near read makes application crash with timeout error when one of replica server is down </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2413'>NODE-2413</a>] - The node process enters an infinite loop at the pool and causes OOM </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2442'>NODE-2442</a>] - journal=true is ignored in connection string </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2548'>NODE-2548</a>] - Change streams do not resume from errors </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2565'>NODE-2565</a>] - Change stream should not check for NonResumableChangeStreamError label </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2619'>NODE-2619</a>] - Unordered bulk write aborts on first encountered error </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2625'>NODE-2625</a>] - BulkWriteError should always have a writeErrors field </li> </ul>
<h3> Task </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2478'>NODE-2478</a>] - Use white list for change stream resumability </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2598'>NODE-2598</a>] - Change stream close refactor </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2605'>NODE-2605</a>] - Refactor shared test helpers to improve usability </li> </ul>
<h3> Improvement </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2522'>NODE-2522</a>] - Remove ElectionInProgress (216) from ResumableChangeStreamError </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2571'>NODE-2571</a>] - Don't use admin database for FLE tests </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2630'>NODE-2630</a>] - Simplify code path for ending implicit sessions in cursors </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.7 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.7 of the driver
Work earlier this year left some dead code in our operations code, resulting in this warning message reported by multiple users. While we still have a few cycles in our codebase yet, this will quiet Node.js 14's circular dependency warnings.
Drivers use an implicit session for all operations where an explicit session is not provided. A subtle bug was introduced when session support was implemented where implicit sessions were created and assigned to operations even if they were about to sit in a queue waiting for execution. This results in the driver creating many sessions rather than reusing pooled ones. The fix is to ensure a session is only checked out of the pool when the operation is about to be written to a server.
Thanks very much to all the community members who contributed to this release!
<h2> Bug </h2> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2536'>NODE-2536</a>] - Circular dependency in Node.js 14 nightly </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2552'>NODE-2552</a>] - Server session creation grows unbounded with every operation call </li> </ul>
<h2> Improvement </h2> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2534'>NODE-2534</a>] - Document options supported by the unified topology </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2560'>NODE-2560</a>] - Make 'reIndex' a standalone-only command </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.6 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.6 of the driver
map when cursor used as a stream@dobesv helped identify a regression where a map function would be applied twice if defined on a cursor, and that cursor was used to stream data.
User @linus-hologram originally reported an issue with a TypeError when the lambda
passed to the withTransaction helper rejected with a null value. @vkarpov15
submitted the fix.
readPreferenceTags interpreted as an arrayA bug was fixed where readPreferenceTags with a single value in the connection
string was not properly interpreted as an array of tags. This prevented the
Use Analytics Nodes to Isolate Workload guidance from working
correctly.
User @sean-daley reported seeing this in an AWS Lambda environment, but has proven to be somewhat of a heisenbug. We are rolling out a fix here that ensures sessions (implicit or not) are not used after they have been explicitly ended.
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2503'>NODE-2503</a>] - Cursor ReadStream applies map function twice </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2515'>NODE-2515</a>] - TypeError when transaction is rejected with empty reason </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2541'>NODE-2541</a>] - readPreferenceTags are not interpreted as an array </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2545'>NODE-2545</a>] - Cannot set property 'isDirty' of null </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2549'>NODE-2549</a>] - Unknown topology should return empty array for server selection with read preference </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.5 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.5 of the driver
hasNext when using a cursor with a limit@peterbroadhurst helped point out a regression introduced in v3.5.4 where using hasNext
on a cusor with a limit would not return the full set of results.
A change introduced across all MongoDB drivers, and in particular v3.5.0 of the Node.js
driver, attempted to prevent needless duplicate topologyDescriptionChanged topology events
by introducing a ServerDescription equality operator. Since equality does not take the
lastUpdateTime and lastWriteDate fields of an ismaster into account, the driver could
eventually consider servers non-suitable for server selection, since they would fall out
of the latency window.
All updates are considered viable for topology updates now, and only event emission is
gated by ServerDescription equality.
The legacy topology types (in particular if you were connected to a replic set) used a
custom Timeout class to wrap a timer. Unfortunately, the class depended on an undocumented,
private variable _called, which was removed in Node.js v12. This would lead to the driver
thinking the timeout never occurred, and therefore never releasing the object for garbage
collection. We recommend users of the legacy topology types immediately update to this
version of the driver, or use the Unified Topology which is unaffected by this bug.
@erfanium and @Paic helped us identify an issue in rare failover events where multiple
requests to process the server selection queue would result in an attempted property
access of an undefined variable.
promiseLibrary not respected by newly introduced maybePromise helper@tobyealden pointed out that an internal refactor to use a helper to optionally
return a Promise for top level API methods was not, in fact, using a custom
promise library if one was provided!
Thanks very much to all the community members who contributed to this release!
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2460'>NODE-2460</a>] - Memory Leak with ReplSet and NodeJS v12 </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2472'>NODE-2472</a>] - TypeError on server available with useUnifiedTopology: true </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2474'>NODE-2474</a>] - Server_Description update with lastUpdateTime / lastWriteDate fields is ignored in topology </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2480'>NODE-2480</a>] - TypeError after reconnecting </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2483'>NODE-2483</a>] - Regression using hasNext on cursor with limit </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2490'>NODE-2490</a>] - promiseLibrary option is not honoured </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.4 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.4 of the driver
hasNext when piping a cursorPierre Mallet and @Sintendo helped identify a regression with our cursors which did not
properly rewind a cursor when hasNext was called before the cursor was piped.
A change introduced in v3.5.3 converted the server selection loop from a loop with timers to a queue of callbacks. A subtle bug was introduced to the code to process the quere where the upper bound of a for loop was using a dynamically decreasing length, leading to some operations being ignored, and ultimately timing out. Many thanks to Frederic Maillasson, @paulrobinson, and @adityapatadia for helping uncover this issue
User @millerick submitted a PR short circuiting the background task for ensuring a minimum pool size if no minimum size was set.
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2454'>NODE-2454</a>] - Cursor.hasNext() seems to consume first document when the cursor is piped in a writable stream </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2464'>NODE-2464</a>] - max election ID comparison uses invalid comparison for tracking </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2466'>NODE-2466</a>] - Driver does not seem to properly recover from a long disconnection with primary server </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2467'>NODE-2467</a>] - MongoServerSelectionError when using useUnifiedTopology: true </li> </ul>
<h3> Improvement </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2459'>NODE-2459</a>] - Do not run minimum connection size task if there is no minimum pool size </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.3 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.3 of the driver
This patch release fixes one issue with command error handling during network errors, and one minor issue with multiple incoming wire messages not being properly processed.
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2435'>NODE-2435</a>] - Unified topology does not transition server to Unknown on non-timeout operation error </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2437'>NODE-2437</a>] - Multiple incoming message packets are not processed correctly </li> </ul>
<h3> Improvement </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2438'>NODE-2438</a>] - Add exhaust command support to transport layer </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2449'>NODE-2449</a>] - Simplify server error handling in unified topology </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.2 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.2 of the driver
This patch release corrects a regression introduced in the 4.2 timeframe which would effectively disable retryable operations for connection to MongoDB 4.2+. Additionally, the server selection loop has been converted to a queue of callbacks to improve readability, as well as performance in certain scenarios.
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2408'>NODE-2408</a>] - retryWrites seems not to work as expected in failover test </li> </ul>
<h3> Improvement </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2398'>NODE-2398</a>] - Use a queue for server selection </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.1 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.1 of the driver
This patch release fixes a few regressions introduced with new connection pool, primarily around the ability to use custom TLS certificates.
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2372'>NODE-2372</a>] - db.findOne does not respect client setting bufferMaxEntries </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2401'>NODE-2401</a>] - "readPreference.equals is not a function" exception thrown within executeWithServerSelection </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2424'>NODE-2424</a>] - CMAP connection pool fails to create connection using SSL / TLS </li> </ul>
The MongoDB Node.js team is pleased to announce version 3.5.0 of the driver
The MongoDB Node.js team is pleased to announce version 3.5.0 of the driver
This release introduces a modern replacement for the driver's connection pool, available only with the unified topology. A major effort was made in early 2019 to fully specifiy connection pools for MongoDB drivers (see: CMAP specification), and this release brings the Node.js driver in line with that specification.
The new pool supports monitoring for all aspects of its behavior. This allows deep introspection into the operation of the connection pool, as well as an ability to profile the lifetime of an operation when used in conjunction with command monitoring.
The Connection class was completely rewritten for the new pool adopting a stream-first mentality. All
wire message processing and compression is handled in a duplex stream called the MessageStream, and
that stream is connected bidirectionally to the underlaying TCP socket. The result is a connection which
gains the general benefit of streams: better performance, less memory pressure, backpressure support. It
also opens the possiblity of supporting non-TCP/UDP streams as a transport for the driver.
The new connection pool has a concept of a "wait queue", which allows operation requests to buffer waiting
for a connection to execute against. There is no timeout by default, but users can now specify a new value
waitQueueTimeoutMS in their connection string or MongoClient options to proactively cancel operations
that have waited too long.
Remember that the new connection pool is only available for the "Unified Topology", so remember to pass
useUnifiedTopology: true to your MongoClient constructor to use it!
Both the legacy and unified SDAM implementations have until now executed monitoring checks as priority
messages in the legacy Pool implementation. This means that monitoring (ismaster) operations were
prioritized over other queued operations, but also means that monitoring could be indefinitely blocked,
in particular during failover or black hole scenarios. The default socket timeout is null (read: Infinity),
so if the pool was completely saturated with operations, there may be no ability to execute a monitoring
check and determine that the connection to a server was no longer valid. This version of the driver
introduces a new Monitor class which manages its own dedicated monitoring connection to each known
node.
In v3.3.0 of the driver we introduced a new MongoTimeoutError for all errors covered by the server
selection loop, leading to a spike in bug reports with a title similar to Server selection timed out after 30000ms.
Even though the error type itself had an attached reason field, we still feel it was easy to miss why
the selection had failed. As a result we have introduced a new type MongoServerSelectionError which
will use the originating error (reason) for its message, better informing users what caused a
selection error, while still also conveying it is an error in server selection.
<h3> New Feature </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1742'>NODE-1742</a>] - Implement Connection Monitoring and Pooling spec </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2386'>NODE-2386</a>] - Use a dedicated monitoring thread </li> </ul>
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2400'>NODE-2400</a>] - Synchronous errors are swallowed by executeOperation </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2417'>NODE-2417</a>] - Server descriptions with me mismatch from primary response should be removed </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2418'>NODE-2418</a>] - client platform not sent in metadata for CMAP connections </li> </ul>
<h3> Improvement
</h3>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1619'>NODE-1619</a>] - Remove wasteful empty Buffer allocations in Connection
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2049'>NODE-2049</a>] - Add "connectionError" as a valid "reason" for a ConnectionCheckOutFailedEvent when connection set up fails
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2397'>NODE-2397</a>] - Make server selection errors more informative
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2402'>NODE-2402</a>] - Integrate CMAP connection pool into unified topology
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2419'>NODE-2419</a>] - Improve traceability of CMAP events
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2033'>NODE-2033</a>] - Ignore ConnectionReadyEvent in CMAP pool creation test
</li>
</ul>
The MongoDB Node.js team is pleased to announce version 3.4.1 of the driver
The MongoDB Node.js team is pleased to announce version 3.4.1 of the driver
This is a patch release addressing two regressions introduced in bulk writes and SCRAM authentication.
<h2> Bug </h2> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-2383'>NODE-2383</a>] - Unordered bulk write reports wrong error indexes </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2390'>NODE-2390</a>] - Sporadic connection errors with AWS Lambda </li> </ul>
NOTE: your application will not break if you continue to use the ssl variants, but deprecation warnings will be introduced prior to the 4.x driver rel…
The MongoDB Node.js team is pleased to announce version 3.4.0 of the driver
The major functionality introduced in this release, and indeed the reason for the minor version bump, is full support for MongoDB's Client Side Field Level Encryption. The bulk of the support comes through an addon module mongodb-client-encryption, please refer to the reference documentation for more details.
This release also introduces a number of new connection string options related to TLS. In order to unify uri options across all MongoDB drivers, and to better signal the technology the driver is actually using, all ssl related options now have a corresponding tls variant. NOTE: your application will not break if you continue to use the ssl variants, but deprecation warnings will be introduced prior to the 4.x driver release.
@adityapatadia initially pointed out that these tls variants had no effect, now they do. Thank you @adityapatadia!
A critical bug was found by @ephemer with the recently introduced "mongos discovery", where a typo caused DNS polling to occur at very fast intervals.
Additionally, user @mpilar identified and fixed a bug with our mongodb+srv parsing, where user-provided client options were not overriding those provided by a TXT record lookup.
Thank you very much @ephemer and @mpilar!
@adityapatadia also helped find a bug in the server selection code which rendered selection with a nearest read preference non-functional. Thanks again @adityapatadia!
A small bug was fixed causing errors in an unordered bulk write to be reported in incorrect order. If an error occurs in a bulk write now, then it will show up in the writeErrors field of the resulting BulkWriteError with an index that corresponds to the position the operation had in the initial input.
<h2> Bug
</h2>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1547'>NODE-1547</a>] - Default Port is not applied
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1991'>NODE-1991</a>] - replaceOne() also returns the replacement document?
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2089'>NODE-2089</a>] - Only apply TransientTransactionError label within a transaction
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2308'>NODE-2308</a>] - Bulk write error returns incorrect index in WriteError for unordered writes
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2334'>NODE-2334</a>] - Driver must error if autoEncryption is attempted against wire version < 8
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2335'>NODE-2335</a>] - Node Driver does not follow Initial DNS Seedlist Discovery spec
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2353'>NODE-2353</a>] - Timed out connections should not half-close on destroy
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2356'>NODE-2356</a>] - nearest server is not selected when useUnifiedTopology is set
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2359'>NODE-2359</a>] - tls option in connection URI has no effect
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2375'>NODE-2375</a>] - Typo in rescanIntervalSrvMS causes spike in DNS lookups
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2376'>NODE-2376</a>] - Malicious server can accept incomplete SCRAM authentication and bypass mutual authentication
</li>
</ul>
<h2> New Feature </h2> <li>[<a href='https://jira.mongodb.org/browse/NODE-2094'>NODE-2094</a>] - FLE GA Support </li> <ul> </ul>
<h2> Improvement
</h2>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2024'>NODE-2024</a>] - Document createIndexes usage
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2052'>NODE-2052</a>] - [FLE] Add a corpus test that exhaustively enumerates all ways to encrypt all BSON value types
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2053'>NODE-2053</a>] - [FLE] Add prose test for explicit encryption with key alt name
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2298'>NODE-2298</a>] - Add driver API documentation for Field Level Encryption
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2363'>NODE-2363</a>] - Allow connection establishment to be cancelled
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2306'>NODE-2306</a>] - Driver module does not export BulkWriteError
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2338'>NODE-2338</a>] - build FLE addon on windows
</li>
</ul>
[ NODE-2348 ] - Document and notify on deprecated events and options for unified topology
The MongoDB Node.js team is pleased to announce version 3.3.5 of the driver
This patch release includes additional fixes for the regression in the unified topology discovered in v3.3.2, expanding our testing infrastructure to include a simulated workload during failover testing. There was a bug when connecting to single-node replicasets which could result in a stack overflow which was corrected. Additionally, events and options which are incompatible with the unified topology will now emit a warning message.
The release also includes a fix submitted by @mpilar, who found an inconsistency in our implementation of the "Initial Seedlist Discovery" specification. An authSource specified in the options passed to MongoClient would be overridden by an authSource provided in the TXT record checked during initial seedlist discovery over SRV. Thank you very much Miguel!
BulkWriteError is now exported at the top level of the module so that users can catch them easily. Additionally, a fix was made to ensure that the index of operations passed into an unordered bulk operation were preserved when reporting possible errors in the future.
<h2> Bug </h2> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1747'>NODE-1747</a>] - Replica set causes MongoNetworkError due to not connecting with fully qualified domain name </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2089'>NODE-2089</a>] - Only apply TransientTransactionError label within a transaction </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2143'>NODE-2143</a>] - getaddrinfo ENOTFOUND error on Windows 10 due to failed fallback to ipv4 after ipv6 lookup fails </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2308'>NODE-2308</a>] - Bulk write error returns incorrect index in WriteError for unordered writes </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2332'>NODE-2332</a>] - useUnifiedTopology - replicaset </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2335'>NODE-2335</a>] - Node Driver does not follow Initial DNS Seedlist Discovery spec </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2342'>NODE-2342</a>] - Enabling useUnifiedTopology results in stack overflow when connecting to uninitialized replica set </li> </ul>
<h2> Improvement
</h2>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2348'>NODE-2348</a>] - Document and notify on deprecated events and options for unified topology
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2306'>NODE-2306</a>] - Driver module does not export BulkWriteError
</li>
</ul>
The MongoDB Node.js team is pleased to announce version 3.3.4 of the driver
The MongoDB Node.js team is pleased to announce version 3.3.4 of the driver
This release primary consists of improvements to the "unified topology". In particular, a regression with interaction between the connection pool and topology could result in servers which "go away" (due to network error, for example) would not return, resulting in a MongoTimeoutError.
<h2> Bug
</h2>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2123'>NODE-2123</a>] - MaxListenersExceededWarning caused by topologyDescriptionChanged
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2214'>NODE-2214</a>] - Incorrect removal of Unknown server type from ReplicaSetNoPrimary topology
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2234'>NODE-2234</a>] - isConnected() takes legacy path with useUnifiedTopology
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2251'>NODE-2251</a>] - useUnifiedTopology continuously emits 'close' event when replica set member is down
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2268'>NODE-2268</a>] - Legacy SDAM ReplSet topology reports incorrect topology ID
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2270'>NODE-2270</a>] - Servers are not removed from unknownServer list, leaking
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2274'>NODE-2274</a>] - Unified topology never regains nodes which temporarily go down
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2277'>NODE-2277</a>] - Unhandled error when server is offline
</li>
</ul>
<h2> Improvement </h2> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1517'>NODE-1517</a>] - normalize state management across all stateful types </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2257'>NODE-2257</a>] - Introduce ServerDescription equality to reduce SDAM events </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2263'>NODE-2263</a>] - support ability to pass hint to update </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2276'>NODE-2276</a>] - Add SDAM test for debouncing topology description updates </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2280'>NODE-2280</a>] - Integrate a state machine into the unified topology </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2309'>NODE-2309</a>] - Document the design and rationale of the unified topology </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2316'>NODE-2316</a>] - Correct client metadata for unified topology </li> </ul>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
The MongoDB Node.js team is pleased to announce version 3.3.0 of the driver
The MongoDB Node.js team is pleased to announce version 3.3.0 of the driver
This latest release brings support for features in the newly released MongoDB v4.2:
$merge operatorThe Driver has supported connecting to a cluster using an SRV record since version 3.0. Prior to now, we would only resolve the SRV record when initially connecting. This was fine for single replica sets, as the driver is able to discover new members added after initial connect from any member of a replica set. However, in a sharded deployment, individual mongos processes do not have an awareness of each other. This means that if the deployment changes in a shared cluster, the driver would have no way of knowing without disconnecting and connecting with a new client.
Starting in 3.3, if a driver connects to a sharded cluster with an SRV record, we will now periodically check that SRV record for any changes in the deployment, and update the client-side connections accordingly.
**NOTE: This feature is only available when starting a client with { useUnifiedTopology: true } **
The driver now has support for MongoDB Client-Side Encryption. This requires installing the mongodb-client-encryption npm package in your project.
mongodb-core into node-mongodb-nativeUp until this release, the mongodb driver has consisted of two components:
mongodb-core: The low-level engine of the driver.node-mongodb-native: The API layer of the driver, published as mongodbOver time, this separation has done more harm than good, and has led to increased development time for repairing bugs and implementing new features. Starting in the 3.3 release of mongodb, we have merged mongodb-core into node-mongodb-native, removing this barrier to development.
<h3> Bug </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1480'>NODE-1480</a>] - 'Should handle Error thrown during operation' in error_tests.js should handle exception </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1994'>NODE-1994</a>] - fix 'should correctly handle multiple unordered batch API' </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2022'>NODE-2022</a>] - startAtOperationTime and resumeToken conflict on cursor restarts </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2051'>NODE-2051</a>] - MongoClient with autoEncryption does not clean up MongoCryptD client </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2054'>NODE-2054</a>] - [FLE] AutoEncrypter MongoClient does not use new url parser </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2060'>NODE-2060</a>] - can't use database named 'constructor' </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2067'>NODE-2067</a>] - requestid overflow </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2075'>NODE-2075</a>] - Ensure error events also emit close events in change_stream.js </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2077'>NODE-2077</a>] - Invalid staleness calculation </li> </ul>
<h3> Epic </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1405'>NODE-1405</a>] - Improve command construction </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1744'>NODE-1744</a>] - Retryable Reads </li> </ul>
<h3> New Feature
</h3>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1740'>NODE-1740</a>] - Implement Unified URI Options
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1745'>NODE-1745</a>] - Support polling SRV records for mongos discovery
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1750'>NODE-1750</a>] - Connections survive primary stepdown
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1766'>NODE-1766</a>] - Aggregate command must be sent to a primary if it uses $out
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1820'>NODE-1820</a>] - Resync CRUD spec tests to use transaction spec test format
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1824'>NODE-1824</a>] - Support 'startAfter' option to the $changeStream stage
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1864'>NODE-1864</a>] - Support Retryable Writes on by Default
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1866'>NODE-1866</a>] - Support postBatchResumeToken in change streams
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1880'>NODE-1880</a>] - Add support for majority read concern level to Aggregation $out
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1896'>NODE-1896</a>] - Implement executeOperationV2
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1902'>NODE-1902</a>] - Add "aspects" to all operation classes
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1920'>NODE-1920</a>] - Add the ability to specify a pipeline to an update command
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1931'>NODE-1931</a>] - Ensure 4.0 drivers return an error when attempting sharded transactions on 4.2
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1965'>NODE-1965</a>] - More useful error when bulk writes fail
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2023'>NODE-2023</a>] - set default for useRecoveryToken to true
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2071'>NODE-2071</a>] - [FLE]: use crypto callbacks
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2078'>NODE-2078</a>] - Improve error message for missing mongodb-client-encryption
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2095'>NODE-2095</a>] - Operating System Removals/Updates for 4.2
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2098'>NODE-2098</a>] - Raise an actionable error message when retryWrites fails due to using an unsupported storage engine
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2102'>NODE-2102</a>] - Mark the FLE feature as "Beta" in driver docs
</li>
</ul>
<h3> Task </h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1854'>NODE-1854</a>] - POC - Support Client-side Field Level Encryption </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1949'>NODE-1949</a>] - Add tests for postBatchResumeToken support </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1950'>NODE-1950</a>] - Test writes in transactions do not send writeConcern when collection write concern is w=0 </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1951'>NODE-1951</a>] - Amend change stream missing resume token tests for wire version 8+ </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1966'>NODE-1966</a>] - Merge core and native modules into a single driver </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1979'>NODE-1979</a>] - Clarify resume token used in resuming and getResumeToken </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2004'>NODE-2004</a>] - Spec: Finer-grained updates from aggregation via $merge </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-2017'>NODE-2017</a>] - Fix result assertion in change stream spec test </li> </ul>
<h3> Improvement
</h3>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1425'>NODE-1425</a>] - validate internal representation of ReadPreference
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1557'>NODE-1557</a>] - Clean up constructor for ClientSession
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1682'>NODE-1682</a>] - Implement connection pool reset
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1756'>NODE-1756</a>] - applyWriteConcern should take a writeConcern
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1811'>NODE-1811</a>] - Refactor readconcern tests
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1897'>NODE-1897</a>] - Move all operations to their own classes
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1910'>NODE-1910</a>] - Refactor findAnd* operations to extend findAndModify
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1943'>NODE-1943</a>] - Move executeOperation to executeLegacyOperation
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1944'>NODE-1944</a>] - Use new CommandOperation for operations
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1947'>NODE-1947</a>] - create a MongoNamespace for database and collection classes
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1962'>NODE-1962</a>] - Remove duplicate operation code
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1976'>NODE-1976</a>] - ChangeStream spec's Resumable Error definition is too broad
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1977'>NODE-1977</a>] - Discard ServerSessions involved in network errors
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2016'>NODE-2016</a>] - Test MongoDB 4.2 in Evergreen
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2025'>NODE-2025</a>] - Fix Node is Recovering error handling
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2063'>NODE-2063</a>] - Simplify cursor constructor
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2064'>NODE-2064</a>] - Use AggregateOperation for aggregation cursors
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2065'>NODE-2065</a>] - Simplify cursor session management
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2066'>NODE-2066</a>] - Cursor should use wire protocol primitives on stored server
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2068'>NODE-2068</a>] - Perform server selection for sessions check if required
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-2079'>NODE-2079</a>] - Add attribute fullResponse to CommandOperationV2
</li>
</ul>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
With the v3.1.0 release we officially deprecated the 2.x driver. With this release that driver is effectively EOL, and will no longer be supported. Pl…
The MongoDB Node.js team is pleased to announce version 3.2.1 of the driver.
Due to a publishing snafu v3.2.1 was immediately published without a proper v3.2.0 release
<h2>Release Highlights</h2>
<h3>2.x EOL</h3> With the v3.1.0 release we officially deprecated the 2.x driver. With this release that driver is effectively EOL, and will no longer be supported. Please update your driver as soon as possible.
<h3>Unified Topology</h3>
In this release we are very excited to announce the immediate availability of a complete rewrite of the driver's "topology" layer. This is the core brains of the driver responsible for things like server selection, server discovery and monitoring. This work combines the three existing topology concepts (Mongos, ReplSet, and Server) into a single type Topology. The new Topology type uses the same machinery to represent all three types, greatly improving our ability to maintain the code, and reducing the chance for bug duplication.
The Topology class no longer uses a callback store, instead relying on a server selection loop for operation execution. This means failed operations will fail faster, with more accurate stack traces and specifics about the failure. It generally makes it much easier to reason about what the driver is doing each time an operation is executed.
You can enable it with the useUnifiedTopology feature flag passed to your MongoClient constructor, like so:
const client = MongoClient('mongodb://localhost:27017', { useUnifiedTopology: true });
This topology layer will replace the existing topologies in a breaking 4.x release later this year, so we strongly encourage our users to try it out as soon as possible.
<h3>withTransaction helper</h3>
Reliably committing a transaction in the face of errors can be a complicated endeavor using the MongoDB 4.0 drivers API. This version introduces a withTransaction helper method on the ClientSession object that allows application logic to be executed within a transaction. This method is capable of retrying either the commit operation or entire transaction as needed (and when the error permits) to better ensure that the transaction can complete successfully. Consider using this for all but the most complicated of transactions use cases.
A call to withTransaction begins a new transaction, executes the provided function, and then attempts to commit the transaction. The function passed to withTransaction must take a session parameter, and this session must be passed to all methods within the function. If some error is encountered, it will attempt to re-commit the transaction before ultimately failing back to the user after aborting the transaction.
NOTE: A mentioned, the passed in function MAY be retried multiple times, please keep this in mind when executing non-database operations within the function.
Here’s an example of it in action:
const client = new MongoClient();
await client.connect();
const session = client.startSession();
// NOTE: the `withTransaction` method only supports functions that return a `Promise`
try {
await session.withTransaction(async function(session) {
const coll = client.db('foo').collection('coll');
await coll.insertOne({ a: 42 }, { session });
});
} catch (err) {
// transaction failed after attempted retry
console.dir({ err });
}
<h3>Cursors support asyncInterator and for..await..of loops</h3>
Symbol.asyncIterator is defined on cursors for Node.js versions that support it (>=v10.x.x). This allows you to use for..await..of loops with cursors:
client.connect().then(async function() {
const collection = client.db(‘test’).collection(‘asyncIterators’);
const cursor = collection.find();
for await(const doc of cursor) {
console.log(item);
}
});
<h3>OP_MSG</h3> This release also brings support for a new wire protocol introduced originally in version 3.6 of the server.
<h3>Database-level aggregation</h3>
The server supports several collection-less aggregation source stages like $currentOp and $listLocalSessions. In this version we have added a Db.prototype.aggregate helper for database-level aggregations.
<h3>Authentication</h3>
Since the 3.6 server release, multiple authentication contexts for a single MongoClient have been prohibited. This release cleans up the final bits of internal api related to multiple auth contexts, and greatly improves our ability to maintain this code. This not only involved simplifying the implementation of our auth providers, but also a large refactor of how connections are established and handshaked. Calls to auth and logout are now no-ops, and top level API for this will be removed in the next major release.
<h2>Release Notes</h2> <h3>Bug</h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1534'>NODE-1534</a>] - retryWrites=true, remove, and limit=0 </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1658'>NODE-1658</a>] - Fix normalizing option names coming from connection string </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1685'>NODE-1685</a>] - SCRAM-SHA-256 tests are not actually run against replicaset </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1687'>NODE-1687</a>] - Replicaset tests for core use Server and require primary on port 31000 </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1736'>NODE-1736</a>] - Explain useNewUrlParser </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1778'>NODE-1778</a>] - BulkWrite: Incorrect batch-size calculations causes batch to fail </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1782'>NODE-1782</a>] - New Topology layer fails to clear monitor on close </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1840'>NODE-1840</a>] - useNewUrlParser: true causes "command find requires authentication" </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1874'>NODE-1874</a>] - Wrong JavaScript const use in lib/operations/db_ops.js </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1876'>NODE-1876</a>] - Uncatchable exceptions </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1898'>NODE-1898</a>] - BulkWrite: Incorrect batch-size calculations when array contains object with undefined value </li> </ul>
<h3>New Feature</h3> <ul> <li>[<a href='https://jira.mongodb.org/browse/NODE-1085'>NODE-1085</a>] - OP_MSG support </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1259'>NODE-1259</a>] - Refactor mongodb-core to use a single Topology type </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1684'>NODE-1684</a>] - Define [Symbol.iterator] on our Cursor objects </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1741'>NODE-1741</a>] - Implement Convenient API for Transactions </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1783'>NODE-1783</a>] - Support running commands as aggregation </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1792'>NODE-1792</a>] - Update handling of write concern errors by user management commands </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1793'>NODE-1793</a>] - Transaction test runner should use "local" read concern when asserting the final collection state </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1841'>NODE-1841</a>] - Disable TLS renegotiation when possible </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1850'>NODE-1850</a>] - Drivers should ignore batchSize=0 for aggregate with $out </li> <li>[<a href='https://jira.mongodb.org/browse/NODE-1879'>NODE-1879</a>] - Resync transaction spec tests for bulk write error reporting change </li> </ul>
<h3>Improvement</h3>
<ul>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1264'>NODE-1264</a>] - provide pre-built binaries for kerberos and ext-bson using node-pre-gyp
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1291'>NODE-1291</a>] - Integrate single Topology from Core into Native
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1334'>NODE-1334</a>] - Remove mutation of user-owned objects
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1385'>NODE-1385</a>] - Remove JSDOC that says [param=null]
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1435'>NODE-1435</a>] - Remove unnecessary auth code from connection pool
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1436'>NODE-1436</a>] - Remove duplicated code from auth providers
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1437'>NODE-1437</a>] - Implement auth connection string tests
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1442'>NODE-1442</a>] - Refactor Auth to exclusively use a MongoCredential object
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1453'>NODE-1453</a>] - Resync SDAM tests
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1491'>NODE-1491</a>] - Add option for applications to register a custom server selector
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1620'>NODE-1620</a>] - Port authentication support to new Topology class
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1644'>NODE-1644</a>] - Deprecate parallelCollectionScan helpers
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1674'>NODE-1674</a>] - Fix auth workflow with regards to auth mechanism resolution
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1683'>NODE-1683</a>] - Evaluate and correct monitoring in new SDAM layer
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1688'>NODE-1688</a>] - Update atlas connectivity tests to use new auth credentials
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1731'>NODE-1731</a>] - CI Test against Node 10.x (Dubnium)
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1732'>NODE-1732</a>] - Update Travis version of MongoDB
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1823'>NODE-1823</a>] - Update unified topology to use refactored wire protocol
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1830'>NODE-1830</a>] - Reduce creation of OP_QUERY to wire protocol classes
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1845'>NODE-1845</a>] - Allow Connection to be shared with mock server
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1859'>NODE-1859</a>] - Remove dead authentication code in pool and topologies
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1860'>NODE-1860</a>] - Ensure ssl is honored when provided in URI
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1863'>NODE-1863</a>] - Move connection handshake logic out of Server topology class
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1888'>NODE-1888</a>] - countDocuments should use group with _id: 1
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1890'>NODE-1890</a>] - Do not run sharding transaction tests for mongodb < 4.1.5
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1892'>NODE-1892</a>] - Move all command modifying sessions methods out of pool
</li>
<li>[<a href='https://jira.mongodb.org/browse/NODE-1895'>NODE-1895</a>] - Refactor insertMany to remove resultMutator
</li>
</ul>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.