Skip to content

Instantly share code, notes, and snippets.

@rpechayr
Last active August 26, 2016 09:53
Show Gist options
  • Save rpechayr/9af14ad81437bc0cbd12 to your computer and use it in GitHub Desktop.
Save rpechayr/9af14ad81437bc0cbd12 to your computer and use it in GitHub Desktop.
Upgrading to Mongoid 5.x

Upgrade to Mongoid 5.x

Mongoid 5 is a major upgrade to Mongoid for several reasons :

Here is a non comprehensive list of things to chexk or upgrade.

  • Mongoid.yml. The driver changes, so the options you pass to mongoid.yml also do. You should generate a brand new one and find the equivalent options you were using. The sessions entry has been replaced by the clients entry.
  • Aggregation. User.collection.aggregate now requires an array as argument, not a variable number of hashes
  • Moped:: classes like Errors or BSON don't exist anymore.
  • find_and_modify has been removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment