mongoid breaking changes
Updated December 4, 2026
On this page
Latest version 9.1.3, released November 25, 2026. Source repository
Its 8.0.1 release requires Ruby 2.6 or later. Ruby end of life dates.
- From 8.0.1 to 9.0.0: 11 breaking changes in 1 version.
- From 3.0.0 to 9.0.0: 93 breaking changes in 8 versions.
mongoid 9.0.0 breaking changes
- Removed
Rails 2.6 and Rails 5 are no longer supported by this release. github.com - Removed
Mongoid.QueryCache
Mongoid::QueryCache, previously deprecated, is removed in this release. github.com - Behavior changed
String values assigned to numeric fields are now converted to BigDecimal values. github.com - Behavior changed
Hashes in an array assigned to a field are now always converted to BSON::Document, matching loaded data. github.com - Behavior changed
Saving a model in a session other than the one that loaded it now logs a warning. github.com - Behavior changed
Accessing a field excluded by the query projection now raises Mongoid::Errors::AttributeNotLoaded rather than ActiveModel::MissingAttributeError. github.com - Behavior changed
Dates assigned to time-valued fields are now typecast using the app's configured time zone. github.com - Behavior changed
estimated_count
Calling estimated_count with a default scope active now raises Mongoid::Errors::InvalidEstimatedCountScoping. github.com - Behavior changed
touch
After touch, the model is no longer reported as changed, since the touch persisted it. github.com - Default changed
Updating an embedded document now touches its parent by default. Set touch to false on the association if you do not want this. github.com - Default changed
Mongoid.around_embedded_document_callbacks
Around callbacks for embedded documents are now off by default. Enable them with the Mongoid.around_embedded_document_callbacks option if your code relies on them. github.com
mongoid 8.0.1 breaking changes
- Removed
Deprecated constants are removed, so code referencing them must change. github.com - Removed
Criteria and contextual caching is removed, so code relying on cached results must change. github.com - Removed
Document.to_a
Document#to_a is removed. Code calling it must be updated. github.com - Removed
drop_dup
The drop_dup option is removed from the index macro. github.com - Removed
geo_spacial
The deprecated geo_spacial method is removed. github.com - Removed
id_sort
The :id_sort option is removed; #first and #last now accept a limit argument instead. github.com - Removed
Mongoid.Errors.EagerLoad
The deprecated Mongoid::Errors::EagerLoad error class is removed. github.com - Removed
update_values
The update_values method is removed from the Hash and Array extensions. github.com - Behavior changed
Declaring fields with undefined string or symbol types is now prohibited, so such declarations must be changed. github.com - Behavior changed
The taken error message text now matches ActiveRecord and Rails I18n, so code matching the old message must change. github.com
And 3 more in this version. Sign up to see every change
mongoid 7.0.0 breaking changes
- Removed
Servers older than 2.6.0 are no longer supported. github.com - Removed
QueryCache.read_or_server_selector
This method is gone; code calling it will fail. github.com - Behavior changed
Reading attributes with read_attribute or [] now returns demongoized values. github.com - Behavior changed
With unacknowledged writes the destroyed count is no longer reported. github.com - Configuration changed
The MongoDB Ruby driver must be at least version 2.5.1. github.com
mongoid 7.0.0.beta breaking changes
- Renamed
matches?
Calls to matches? must use _matches? instead. github.com - Behavior changed
Readonly attribute behavior was changed to match ActiveRecord. Review code that assigns readonly attributes. github.com - Behavior changed
The error raised when a _type field does not match a class name is reworded; code matching on the old message may break. github.com - Behavior changed
Range.mongoize
Range#mongoize mongoizes to a String when it receives a string rather than a Range. Check code that relied on the previous result. github.com
mongoid 6.0.0.rc0 breaking changes
- Behavior changed
Criteria.map
Criteria#map uses pluck instead of only; code relying on the previous behavior may change. github.com - Behavior changed
only
only and without methods are not scoped to specific locales unless explicitly requested. github.com
mongoid 6.0.0.beta breaking changes
- Removed
Mongoid 6 requires Ruby greater than 2.2.2. github.com - Removed
run_targeted_callbacks
run_targeted_callbacks has been taken out of Mongoid. github.com - Behavior changed
Field names are validated, so previously accepted invalid field names may now be rejected. github.com - Behavior changed
Several behavior changes in Mongoid 6 apply to existing code, including belongs_to now being required by default and comparison operators returning false instead of raising. github.com - Behavior changed
Criteria.first
first and last now offer an option to include or exclude sort; existing calls may return different results. github.com - Behavior changed
Criteria.reorder
Calling reorder no longer mutates the original criteria object. github.com - Behavior changed
Date.mongoize
DateTime#mongoize and Date#mongoize return nil for invalid strings instead of previous behavior. github.com - Behavior changed
Model.with
Model#with now raises an exception when given invalid driver options. github.com - Behavior changed
Mongoid.Attributes.Dynamic
Cloning documents with unknown attributes no longer includes Mongoid::Attributes::Dynamic. github.com - Default changed
belongs_to
belongs_to relations are required by default; users must pass an option to override the requirement. github.com
Older versions
3 older versions, each with its first changes. Sign up to see every change
Show 3 older versions
mongoid 5.0.0 breaking changes
- Removed
MongoDB 2.2 is no longer supported; use MongoDB 2.4 or higher. github.com - Removed
Document.deleted?
The deleted? alias is gone; use destroyed? instead. github.com
And 7 more in this version.
mongoid 4.0.0 breaking changes
- Removed
allow_dynamic_fields
Include Mongoid::Attributes::Dynamic in each model that needs dynamic fields. github.com - Removed
attr_accessible
Use Strong parameters for mass assignment protection. github.com
And 37 more in this version.
mongoid 3.0.0 breaking changes
- Removed
Only has_one, has_many, has_and_belongs_to_many and belongs_to relation macros exist now. github.com - Removed
autocreate_indexes
The autocreate_indexes configuration option has been removed and must no longer be set. github.com
And 30 more in this version.
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.