// the find
mongodb/mongoid
The Official Ruby Object Mapper for MongoDB
Mongoid is the official ODM for MongoDB in Ruby, maintained by MongoDB Inc. itself. It maps Ruby objects to MongoDB documents with ActiveModel/ActiveRecord-like APIs, making it the default choice for Rails apps that want MongoDB instead of a relational DB. If you're already sold on MongoDB, this is the only serious option in the Ruby ecosystem.
Active maintenance by MongoDB's own team means compatibility with new MongoDB server features (Atlas Vector Search, Client-Side Field Level Encryption, multi-document transactions) lands here first. The embedded document support is genuinely well-designed — `embeds_many`/`embeds_one` with atomic path tracking means you can update nested arrays in-place without pulling the whole document. Broad compatibility matrix is real: MRI 2.7 through 4.0, JRuby 9.4/10.0, MongoDB 3.6 through 8.2, Rails 6.0 through master — that's not lip service, it's backed by an Evergreen CI matrix that tests all combinations. The queryable DSL translates Ruby naturally to MongoDB query operators including `$elemMatch`, `$expr`, and aggregation pipelines.
The N+1 story is worse than ActiveRecord — `includes` for referenced associations works, but it's a second query per association type and the eager loading machinery is complex enough that it breaks in non-obvious ways with scopes and polymorphism. Transactions exist but are awkward: multi-document transactions require explicit session passing through every call, and the embedded document association model doesn't compose cleanly with them. The query API diverges from ActiveRecord in enough subtle ways (no `joins`, different scoping semantics, `pluck` behavior on embedded docs) that muscle memory will burn you on a mixed codebase. Documentation lives on mongodb.com and trails the gem — the API docs in particular are sparse on edge cases that bite you in production, like what actually happens when you call `save` on an embedded document that's been loaded via projection.