Navigation
This version of the documentation is archived and no longer supported.

Upgrade Mongoid

Upgrade to 6.x Series

Mongoid 6.x is compatible with Rails 5 and thus requires >= Ruby 2.2.2.

Please see the list of behavior changes for version 6.0.0.beta and version 6.0.0.rc0 for specific changes that might be required in your code.

Upgrade to 5.x Series

The underlying driver has changed from Moped to the official MongoDB Ruby driver. For all users dropping down to the driver level for operations, please see the driver documentation for help with that API.

All Mongoid configuration options have changed, as the underlying driver has changed from Moped to the core MongoDB Ruby driver. Please see the configuration section for a detailed description of all new options.

All references to session are now replaced with client. This includes the mongoid.yml configuration, store_in options, and all exceptions and modules with Session in the name.

find_and_modify has been removed and replaced with 3 options: find_one_and_update, find_one_and_delete and find_one_and_replace.

text_search has been removed as it is now a $text option in a query from 2.6 on.

Mongoid no longer supports MongoDB 2.2 - support is now for only 2.4 and higher.

first and last no longer add an _id sort when no sorting options have been provided. In order to guarantee that a document is the first or last, it needs to now contain an explicit sort.