# mongodb/mongoid

The Official Ruby Object Mapper for MongoDB

Repository: https://github.com/mongodb/mongoid
Canonical: https://ross.abutalabs.com/products/mongoid
Homepage: https://www.mongodb.com/docs/mongoid
Language: Ruby
License: MIT
License Family: permissive
Topics: mongodb, ruby, ruby-on-rails, mongodb-driver, orm, orm-framework
Last push: 2026-08-21T15:19:38+00:00

## Health v2 (maintenance only)
Score: 93/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 83, longevity 100
- inputs: {"age_days": 6195, "days_push": 12, "days_rel": 117, "gap_med": 1, "n_releases_24m": 24}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3912, forks 1383 (observed 2026-08-28T04:08:28.865558+00:00)

## What it is
Mongoid is the official Object-Document Mapper (ODM) framework for MongoDB in Ruby, built on top of the official Ruby MongoDB driver. It provides ActiveRecord-like modeling, querying, and Rails integration for document-based persistence.

## Use cases
- map Ruby classes to MongoDB documents
- use MongoDB models in a Rails app like ActiveRecord
- query MongoDB with a Ruby DSL instead of raw driver calls
- define associations and validations for document models
- migrate a Rails app from SQL to MongoDB
- manage nested documents and embedded associations in Ruby

## When to choose
- you are building a Ruby or Rails application backed by MongoDB
- you want an ActiveRecord-like API for document data
- you need an officially supported, actively maintained MongoDB ODM

## When to avoid
- your project uses a relational database instead of MongoDB
- you prefer lightweight direct driver access without an ORM layer
- you need an ODM for another language or framework

## Facets
- artifact type: library
- maturity: stable
- function: orm, database-driver, database
- domain: databases, web-development, backend, developer-tools
- platform: ruby, jvm
- tags: mongodb, odm, ruby-on-rails, object-document-mapper, nosql

## Member repositories
- mongodb/mongoid (main) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:28.865558+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:25:04.670187+00:00, confidence not recorded.
  - readme: https://github.com/mongodb/mongoid (fetched 2026-08-28T04:08:28.865558+00:00, sha 9055e68cb750)
  - homepage: https://www.mongodb.com/docs/mongoid (fetched 2026-08-29T09:19:17.030334+00:00, sha 1f0325bdd4e7)
  - site_page: https://www.mongodb.com/docs/atlas (fetched 2026-08-29T09:19:17.037588+00:00, sha f312e042649e)
  - site_page: https://www.mongodb.com/docs/manual (fetched 2026-08-29T09:19:17.039386+00:00, sha 6a4548d2a71b)
  - site_page: https://www.mongodb.com/docs/tools-and-connectors (fetched 2026-08-29T09:19:17.040935+00:00, sha 7c907d21d3d3)
  - site_page: https://www.mongodb.com/docs/drivers (fetched 2026-08-29T09:19:17.042510+00:00, sha 194534c44bc5)
  - site_page: https://www.mongodb.com/docs/atlas/architecture/current/solutions-library (fetched 2026-08-29T09:19:17.044123+00:00, sha 0dfd723aadd5)
  - site_page: https://www.mongodb.com/company/partners (fetched 2026-08-29T09:19:17.047871+00:00, sha 342527daf5e8)
  - site_page: https://www.mongodb.com/company/newsroom (fetched 2026-08-29T09:19:17.045605+00:00, sha e3f69e7b7c0c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
