yarn mongodb 3.3.0

The MongoDB Node.js team is pleased to announce version 3.3.0 of the driver

Release Highlights

Server Version 4.2 feature support

This latest release brings support for features in the newly released MongoDB v4.2:

  • Distributed Transactions
  • On-Demand Materialized Views with the $merge operator
  • Wildcard Indexes
  • Retryable Reads
  • MongoDB Query Language Enhancements.

SRV Polling for Sharded Clusters

The 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 } **

Beta support for MongoDB Client-Side Encryption

The driver now has support for MongoDB Client-Side Encryption. This requires installing the mongodb-client-encryption npm package in your project.

Merged mongodb-core into node-mongodb-native

Up 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 mongodb

Over 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.

Release Notes

Bug



  • [NODE-1480] - 'Should handle Error thrown during operation' in error_tests.js should handle exception

  • [NODE-1994] - fix 'should correctly handle multiple unordered batch API'

  • [NODE-2022] - startAtOperationTime and resumeToken conflict on cursor restarts

  • [NODE-2051] - MongoClient with autoEncryption does not clean up MongoCryptD client

  • [NODE-2054] - [FLE] AutoEncrypter MongoClient does not use new url parser

  • [NODE-2060] - can't use database named 'constructor'

  • [NODE-2067] - requestid overflow

  • [NODE-2075] - Ensure error events also emit close events in change_stream.js

  • [NODE-2077] - Invalid staleness calculation

Epic


New Feature



  • [NODE-1740] - Implement Unified URI Options

  • [NODE-1745] - Support polling SRV records for mongos discovery

  • [NODE-1750] - Connections survive primary stepdown

  • [NODE-1766] - Aggregate command must be sent to a primary if it uses $out

  • [NODE-1820] - Resync CRUD spec tests to use transaction spec test format

  • [NODE-1824] - Support 'startAfter' option to the $changeStream stage

  • [NODE-1864] - Support Retryable Writes on by Default

  • [NODE-1866] - Support postBatchResumeToken in change streams

  • [NODE-1880] - Add support for majority read concern level to Aggregation $out

  • [NODE-1896] - Implement executeOperationV2

  • [NODE-1902] - Add "aspects" to all operation classes

  • [NODE-1920] - Add the ability to specify a pipeline to an update command

  • [NODE-1931] - Ensure 4.0 drivers return an error when attempting sharded transactions on 4.2

  • [NODE-1965] - More useful error when bulk writes fail

  • [NODE-2023] - set default for useRecoveryToken to true

  • [NODE-2071] - [FLE]: use crypto callbacks

  • [NODE-2078] - Improve error message for missing mongodb-client-encryption

  • [NODE-2095] - Operating System Removals/Updates for 4.2

  • [NODE-2098] - Raise an actionable error message when retryWrites fails due to using an unsupported storage engine

  • [NODE-2102] - Mark the FLE feature as "Beta" in driver docs

Task



  • [NODE-1854] - POC - Support Client-side Field Level Encryption

  • [NODE-1949] - Add tests for postBatchResumeToken support

  • [NODE-1950] - Test writes in transactions do not send writeConcern when collection write concern is w=0

  • [NODE-1951] - Amend change stream missing resume token tests for wire version 8+

  • [NODE-1966] - Merge core and native modules into a single driver

  • [NODE-1979] - Clarify resume token used in resuming and getResumeToken

  • [NODE-2004] - Spec: Finer-grained updates from aggregation via $merge

  • [NODE-2017] - Fix result assertion in change stream spec test

Improvement



  • [NODE-1425] - validate internal representation of ReadPreference

  • [NODE-1557] - Clean up constructor for ClientSession

  • [NODE-1682] - Implement connection pool reset

  • [NODE-1756] - applyWriteConcern should take a writeConcern

  • [NODE-1811] - Refactor readconcern tests

  • [NODE-1897] - Move all operations to their own classes

  • [NODE-1910] - Refactor findAnd* operations to extend findAndModify

  • [NODE-1943] - Move executeOperation to executeLegacyOperation

  • [NODE-1944] - Use new CommandOperation for operations

  • [NODE-1947] - create a MongoNamespace for database and collection classes

  • [NODE-1962] - Remove duplicate operation code

  • [NODE-1976] - ChangeStream spec's Resumable Error definition is too broad

  • [NODE-1977] - Discard ServerSessions involved in network errors

  • [NODE-2016] - Test MongoDB 4.2 in Evergreen

  • [NODE-2025] - Fix Node is Recovering error handling

  • [NODE-2063] - Simplify cursor constructor

  • [NODE-2064] - Use AggregateOperation for aggregation cursors

  • [NODE-2065] - Simplify cursor session management

  • [NODE-2066] - Cursor should use wire protocol primitives on stored server

  • [NODE-2068] - Perform server selection for sessions check if required

  • [NODE-2079] - Add attribute fullResponse to CommandOperationV2

latest releases: 4.0.0-beta.0, 3.6.3, 3.6.2...
17 months ago