Docs Menu
Docs Home
/ /

Mongoid

Welcome to the documentation site for Mongoid. Mongoid is the officially supported object-document mapper (ODM) for MongoDB in Ruby. By using Mongoid, you can easily interact with your data and create flexible data models native to Ruby applications.

You can add Mongoid to your Ruby application to connect it to a MongoDB database. Install Mongoid by adding it to your project's Gemfile or set up a runnable project by following one of the Quick Start guides.

You can use Mongoid to connect to MongoDB deployments running on one of the following hosted services or editions:

  • MongoDB Atlas: the fully managed service for MongoDB deployments in the cloud

  • MongoDB Enterprise: the subscription-based, self-managed version of MongoDB

  • MongoDB Community: the source-available, free-to-use, and self-managed version of MongoDB

Learn how to establish a connection to MongoDB Atlas and begin working with data by following one of the following guides:

  • Quick Start - Ruby on Rails

  • Quick Start - Sinatra

To learn how to configure different options in your Mongoid application, see the Configuration section.

To learn how to use Mongoid to interact with your MongoDB data, see the Interact with Data section.

To learn how to model your MongoDB data as Mongoid models, see the Model Your Data section.

To learn how to secure your data by using encryption, see the Secure Your Data section.

To learn how to add Mongoid to an existing application, see the Integrations & Tools section. This section also includes information about the Ruby on Rails framework and other resources.

To learn about the versions of the MongoDB Server, the Ruby language, the Ruby driver, and Ruby on Rails framework that are compatible with each version of Mongoid, see Compatibility.

To view a list of new features and changes in each version, see the What's New section.

To find resources for troubleshooting and to learn about contributing to Mongoid, see Issues & Help.

Next

Quick Start - Ruby on Rails