Navigation

Driver Compatibility

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, meaning a particular version of the driver will generally work with newer versions of the server but may not take advantage of the functionality released in the newer version of the server.

The first column lists the driver versions.

Ruby Driver MongoDB 4.4 MongoDB 4.2 MongoDB 4.0 MongoDB 3.6 MongoDB 3.4 MongoDB 3.2 MongoDB 3.0 MongoDB 2.6 MongoDB 2.4
2.14  
2.13 [1]  
2.12    
2.11   [3]  
2.10   [2] [3]  
2.9      
2.8      
2.7      
2.6      
2.5        
2.4        
2.3          
2.2          
2.0            
[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.

Ruby 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. “D” in a column means support for that Ruby version is deprecated.

Ruby Driver Ruby 2.7 Ruby 2.6 Ruby 2.5 Ruby 2.4 Ruby 2.3 Ruby 2.2 Ruby 2.1 Ruby 2.0 Ruby 1.9 JRuby 9.2 JRuby 9.1 JRuby
2.14 D D            
2.13            
2.12            
2.11            
2.10 D D D D  
2.9   D D D D  
2.8    
2.7    
2.6    
2.5          
2.4            
2.3            
2.2            
2.1            
2.0            

The driver does not support older versions of Ruby.

Rails/ActiveSupport Compatibility

The Ruby driver does not depend on ActiveSupport. However, when an application uses ActiveSupport or Ruby on Rails, it must load the driver’s ActiveSupport compatibility code for behavior like 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.

Atlas Compatibility

Driver version 2.6.1 or higher is recommended when using MongoDB Atlas, as this version has significant performance improvements when TLS connections are used, and all Atlas connections use TLS.

When running on JRuby and connecting to Atlas Free Tier, driver version 2.6.4 or higher and Java 8 or higher are required.

mongo_kerberos Compatibility

The following compatibility table specifies the version(s) of the mongo_kerberos library to use with a specific version of the driver.

Ruby Driver mongo_kerberos 2.1
2.7 - 2.14

JRuby and Kerberos Authentication

If the mongo_kerberos gem is used for Kerberos authentication with JRuby, the the JVM system property “sun.security.jgss.native” to will be set to “true” in order to facilitate the use of the system cache of TGTs (e.g. TGTs obtained with kinit). Any other use of the JGSS library will also be affected by this setting, meaning any TGTs in the system cache will be available for obtaining Kerberos credentials as well.

JRuby and TLS Connections

Due to JRuby limitations:

  • ECDSA server certificates are not supported.
  • OCSP endpoint checking is not performed.