Learn what's new in:
What's New in 2.23
Important
Support for MongoDB Server versions 3.6 and 4.0 is deprecated in this release and will be removed in version 2.24. If you are using MongoDB Server 4.0 or earlier, upgrade to version 4.2 or later.
The Ruby driver 2.23 release includes the following new features, changes, and bug fixes:
Adds support for tracing driver operations with OpenTelemetry. When enabled, this feature traces Ruby driver operations and the corresponding server commands. You can enable tracing in a
Mongo::Clientinstance by setting thetracingoption totrue, or set it globally via theOTEL_RUBY_INSTRUMENTATION_MONGODB_ENABLEDenvironment variable.Adds the
csfle_convert_to_ruby_typesconfiguration option for converting Client-Side Field Level Encryption (CSFLE) types to Ruby types.Adds the Ruby engine (for example, TruffleRuby or JRuby) to the platform field in client metadata logs.
Allows SRV connection strings that use valid hostnames with fewer than three labels.
Correctly implements the
srv_max_hostsURI option.Adds support for Ruby 4.0.
Fixes Client-Side Operations Timeout (CSOT) handling in
with_transactionby correctly handling zero (infinite) and positive timeout values.
To learn more about this release, see the v2.23 Release Notes on GitHub.
What's New in 2.22
The Ruby driver 2.22 release includes the following new features, changes, and improvements:
Adds a sort option for the
update_oneandreplace_onemethods. For more information, see the API documentation for update_one and replace_one.Adds retry logic to
SocketErrorhandling during connection pool checkouts.Fixes an
ArgumentErrorthat occurred when a server was marked asunknown.
To learn more about this release, see the v2.22 Release Notes on GitHub.
What's New in 2.21.1
The Ruby driver 2.21.1 release includes the following new features, changes, and improvements:
Adds the
typeparameter to theMongo::SearchIndex::View#create_oneandMongo::SearchIndex::View#create_manySearch index creation methods. This enables you to create MongoDB Vector Search indexes programmatically. To learn more and view examples, see the MongoDB Search and MongoDB Vector Search Indexes guide.Adds compatibility with Ruby 3.3. To learn more, see Compatibility.
BSON v5.1
The bson gem is the implementation of the BSON specification in
Ruby. bson v5.1 accompanies the Ruby driver v2.21.1
release.
The bson 5.1 release includes the following new features, changes,
and improvements:
Adds the
BSON::Vectortype to represent vectors of numeric values. To learn more, see the BSON::Vector section of the BSON guide.BSON::Documentobjects do not support use of the#deep_symbolize_keys!and#symbolize_keys!methods. In previous versions, the#symbolize_keys!method raises anArgumentErrorwhen used on aBSON::Document, but#deep_symbolize_keys!does not, and only returns aHashrather than aBSON::Document.This release adds a warning when you use
#deep_symbolize_keys!on aBSON::Documentinstance. Inbsonv6.0, this action will raise an error.
To learn more about this release, see the v2.21.1 Release Notes on GitHub.
What's New in 2.21
The Ruby driver 2.21 release includes the following new features:
Supports the Client-Side Operations Timeout (CSOT) feature, which unifies most timeout-related options under a single
timeout_msoption.Supports MongoDB Server version 8.0.
Support for range v2 queries with Queryable Encryption, including a new
trim_factorparameter. For more information about Queryable Encryption, see Queryable Encryption in the MongoDB Server manual.
To learn more about this release, see the v2.21 Release Notes on GitHub.
What's New in 2.20
The Ruby driver 2.20 release includes the following new features:
Discontinues support for Ruby 2.5 and 2.6. Deprecates support for Ruby 2.7 and JRuby 9.2, which will be discontinued in the next minor driver version. Adds support for JRuby 9.4.
Supports the newly-released Ruby-BSON version 5.0.
Allows connection strings without a slash between the hosts and the options. For example,
mongodb://example.com?w=1andmongodb://example.com/?w=1are both valid connection strings now.Sends container runtime and orchestration metadata for the client environment to the server for analytics purposes.
Writes a warning message to the log when detecting the host as a CosmosDB (Azure) or DocumentDB (Amazon) instance.
Attempts retries of read or write operations on a different
mongosinstance in a sharded topology, if possible.
To learn more about this release, see the v2.20 Release Notes on GitHub.