Compatibility
On this page
MongoDB Compatibility
The following compatibility table specifies the recommended version(s) of the MongoDB Ruby Driver for use with a specific version of MongoDB. Except when indicated, the specified driver versions expose or take advantage of the features added in the corresponding server versions.
MongoDB server releases are generally backwards compatible. This means a particular driver version will generally work with newer server versions but might not utilize the new functionalities in those server versions.
The first column lists the driver versions.
Important
MongoDB ensures compatibility between the MongoDB Server and the drivers for three years after the server version's end of life (EOL) date. To learn more about the MongoDB release and EOL dates, see MongoDB Software Lifecycle Schedules.
Compatibility Table Legend
Icon | Explanation |
---|---|
✓ | All features are supported. |
D | Support for the Driver version is deprecated. |
No mark | The Driver version is not tested with the MongoDB version. |
Ruby Driver | MongoDB 8.0 | MongoDB 7.0 | MongoDB 6.0 | MongoDB 5.0 | MongoDB 4.4 | MongoDB 4.2 | MongoDB 4.0 |
---|---|---|---|---|---|---|---|
2.21 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2.19 to 2.20 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
2.18 | ✓ | ✓ | ✓ | ✓ | ✓ | ||
2.17 | ✓ | ✓ | ✓ | ✓ | |||
2.16 | ✓ | ✓ | ✓ | ✓ | |||
2.14 to 2.15 | ✓ | ✓ | ✓ | ||||
2.13 | ✓ [1] | ✓ | ✓ | ||||
2.12 | ✓ | ✓ | |||||
2.11 | ✓ [3] | ✓ | |||||
2.10 | ✓ | ||||||
2.6 to 2.9 | ✓ |
[1] | OCSP verification is implemented as of driver version 2.14. |
[2] | Polling of SRV records in sharded topologies is implemented as of driver version 2.11. |
[3] | (1, 2) Client-side encryption is implemented as of driver version 2.12. |
The driver does not support older versions of MongoDB.
Language Compatibility
The following compatibility table specifies the versions of Ruby supported by the various versions of the MongoDB Ruby Driver.
The first column lists the driver versions.
Compatibility Table Legend
Icon | Explanation |
---|---|
✓ | All features are supported. |
D | Support for the Driver version is deprecated. |
No mark | The Driver version is not tested with the MongoDB version. |
Ruby Driver | Ruby 3.2 | Ruby 3.1 | Ruby 3.0 | Ruby 2.7 | Ruby 2.6 | JRuby 9.4 | JRuby 9.3 | JRuby 9.2 | JRuby 9.1 |
---|---|---|---|---|---|---|---|---|---|
2.20 to 2.21 | ✓ | ✓ | ✓ | D | ✓ | ✓ | D | ||
2.19 | ✓ | ✓ | ✓ | ✓ | D | ✓ | ✓ | ||
2.18 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
2.17 | ✓ | ✓ | ✓ | ✓ | ✓ | ||||
2.16 | ✓ | ✓ | ✓ | ✓ | |||||
2.15 | ✓ | ✓ | ✓ | ✓ | |||||
2.14 | ✓ | ✓ | ✓ | ||||||
2.11 to 2.13 | ✓ | ✓ | ✓ | ||||||
2.10 | ✓ | ✓ | ✓ | ✓ | |||||
2.9 | ✓ | ✓ | ✓ | ||||||
2.6 to 2.8 | ✓ | ✓ | ✓ |
The driver does not support older versions of Ruby.
Rails/ActiveSupport Compatibility
The Ruby driver does not depend on ActiveSupport. However, if your application uses ActiveSupport or Ruby on Rails, you must load the driver's ActiveSupport compatibility code for behavior such as time serialization to be correct:
require 'mongo' require 'mongo/active_support'
Applications using Mongoid 7.0.6 or newer do not need to explicitly load the driver's ActiveSupport code, since Mongoid automatically does so.
TLS/SSL Compatibility
The Ruby driver uses the protocols supported by the underlying Ruby
openssl
extension. The openssl
extension generally exposes
the functionality available in the operating system's OpenSSL library.
Industry best practices, and some regulations, require the use of TLS 1.1 or newer. Some operating systems or versions might not provide an OpenSSL version that supports these TLS versions.
If you use macOS older than 10.13 (High Sierra), you need to install Ruby from rvm, homebrew, macports, or another similar source. See Installing Ruby for more options.
If you use Linux or other non-macOS Unix systems, you can check your OpenSSL version as follows:
openssl version
If the version number is less than 1.0.1, support for TLS 1.1 or newer is not available. Contact your operating system vendor for a solution or upgrade to a newer distribution.
You can check your TLS version by running the following command:
ruby -e "require 'net/http'; require 'json'; puts JSON.parse(Net::HTTP.get(URI('https://www.howsmyssl.com/a/check')))['tls_version']"
After running the command, you must see TLS 1.X
where X
is greater than
or equal to 1
.
To learn more about TLS versions and their security implications, see Transport Layer Security Cheat Sheet.
JRuby and TLS Connections
Due to JRuby limitations:
The driver does not support ECDSA server certificates.
The driver does not perform OCSP endpoint checking.