Skip to content

Commit 81508f3

Browse files
Remove drop_dup options from index macro (#5266)
Co-authored-by: shields <[email protected]>
1 parent 26a363a commit 81508f3

File tree

2 files changed

+26
-33
lines changed

2 files changed

+26
-33
lines changed

source/reference/indexes.txt

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,6 @@ Indexes can be sparse:
6161
index({ ssn: -1 }, { sparse: true })
6262
end
6363

64-
*Deprecated:* In MongoDB 4.0 and earlier, users could control whether to build indexes
65-
in the foreground (blocking) or background (non-blocking, but less efficient) using the
66-
``background`` option.
67-
68-
.. code-block:: ruby
69-
70-
class Person
71-
include Mongoid::Document
72-
field :ssn
73-
index({ ssn: 1 }, { unique: true, background: true })
74-
end
75-
76-
The default value of ``background`` is controlled by Mongoid's
77-
``background_indexing`` :ref:`configuration option <configuration-options>`.
78-
79-
The ``background`` option has `no effect as of MongoDB 4.2
80-
<https://www.mongodb.com/docs/manual/core/index-creation/#comparison-to-foreground-and-background-builds>`_.
81-
82-
*Deprecated:* When using MongoDB 2.6, you can drop the duplicate entries
83-
for unique indexes that are defined for a column that might
84-
already have duplicate values by specifying the ``drop_dups`` option:
85-
86-
.. code-block:: ruby
87-
88-
class Person
89-
include Mongoid::Document
90-
field :ssn
91-
index({ ssn: 1 }, { unique: true, drop_dups: true })
92-
end
93-
94-
The ``drop_dups`` option has been `removed as of MongoDB 3.0
95-
<https://mongodb.com/docs/manual/release-notes/3.0-compatibility/#remove-dropdups-option>`_.
96-
9764
For geospatial indexes, make sure the field being indexed is of type Array:
9865

9966
.. code-block:: ruby
@@ -126,6 +93,25 @@ This only works on the association macro that the foreign key is stored on:
12693
has_and_belongs_to_many :preferences, index: true
12794
end
12895

96+
*Deprecated:* In MongoDB 4.0 and earlier, users could control whether to build indexes
97+
in the foreground (blocking) or background (non-blocking, but less efficient) using the
98+
``background`` option.
99+
100+
.. code-block:: ruby
101+
102+
class Person
103+
include Mongoid::Document
104+
field :ssn
105+
index({ ssn: 1 }, { unique: true, background: true })
106+
end
107+
108+
The default value of ``background`` is controlled by Mongoid's
109+
``background_indexing`` :ref:`configuration option <configuration-options>`.
110+
111+
The ``background`` option has `no effect as of MongoDB 4.2
112+
<https://www.mongodb.com/docs/manual/core/index-creation/#comparison-to-foreground-and-background-builds>`_.
113+
114+
129115
Index Management Rake Tasks
130116
===========================
131117

source/release-notes/mongoid-8.0.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ Mongoid 7 behavior:
303303
end
304304

305305

306+
Removed ``:drop_dups`` Option from Indexes
307+
------------------------------------------
308+
309+
The ``:drop_dups`` option has been removed from the ``index`` macro. This option
310+
was specific to MongoDB server 2.6 and earlier, which Mongoid no longer supports.
311+
312+
306313
Removed ``Document#to_a`` Method
307314
--------------------------------
308315

0 commit comments

Comments
 (0)