*********** Mongoid 7.0 *********** .. default-domain:: mongodb .. contents:: On this page :local: :backlinks: none :depth: 2 :class: singlecol This page describes significant changes and improvements in Mongoid 7.0. The complete list of releases is available `on GitHub `_ and `in JIRA `_; please consult GitHub releases for detailed release notes and JIRA for the complete list of issues fixed in each release, including bug fixes. Please note that improvements that have been backported to Mongoid 6.x are not included in this list. The behavior of :ref:`read-only attributes ` now matches that of ActiveRecord. Referenced associations now support all :ref:`dependent behaviors ` that `ActiveRecord supports `_. :ref:`$unwind ` operator support added to the :ref:`aggregation pipeline builder DSL `. ``background_indexing`` Mongoid :ref:`configuration option ` added. Mongoid 7.0 requires MongoDB server 2.6 or newer, Ruby 2.2.2 or higher and supports Rails 5.1-6.0. New in version 7.0.3: Embedded matchers now support the ``$eq`` operator. New in version 7.0.5: Mongoid now officially supports Rails 6.0. ``set`` Overwrites Complete Document ------------------------------------ **Breaking change:** In Mongoid 7.0.2 and higher, ``set`` fully overwrites the targeted attributes in the database, including any nested documents and nested attributes. This behavior matches that of MongoDB ``$set`` operator. In Mongoid 7.0.1 and lower, ``set`` retained other attributes present in the database below the document being written: .. code-block:: ruby class Product include Mongoid::Document field :tags, type: Hash end product = Product.new(tags: {color: 'black'}) product.set(tags: {size: 'large'}) product # Mongoid 7.0.2+: # => #"large"}> # # Mongoid 7.0.1: # => #"black", :size=>"large"}>