File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -260,9 +260,6 @@ for details on driver options.
260
260
# if the database name is not explicitly defined. (default: nil)
261
261
app_name: MyApplicationName
262
262
263
- # Create indexes in background by default. (default: false)
264
- background_indexing: false
265
-
266
263
# Mark belongs_to associations as required by default, so that saving a
267
264
# model with a missing belongs_to association will trigger a validation
268
265
# error. (default: true)
@@ -420,6 +417,10 @@ for details on driver options.
420
417
# (default: false)
421
418
use_utc: false
422
419
420
+ # (Deprecated) In MongoDB 4.0 and earlier, set whether to create
421
+ # indexes in the background by default. (default: false)
422
+ background_indexing: false
423
+
423
424
ERb Preprocessing
424
425
=================
425
426
Original file line number Diff line number Diff line change @@ -61,8 +61,9 @@ Indexes can be sparse:
61
61
index({ ssn: -1 }, { sparse: true })
62
62
end
63
63
64
- Indexes can be specified to be created in the background in cases where
65
- the collection is large and index creation may take a long time:
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.
66
67
67
68
.. code-block:: ruby
68
69
@@ -72,9 +73,11 @@ the collection is large and index creation may take a long time:
72
73
index({ ssn: 1 }, { unique: true, background: true })
73
74
end
74
75
75
- If the ``background_indexing`` :ref:`configuration option
76
- <configuration-options>` is true, the indexes are created in the background
77
- unless the ``background: false`` option is provided.
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>`_.
78
81
79
82
*Deprecated:* When using MongoDB 2.6, you can drop the duplicate entries
80
83
for unique indexes that are defined for a column that might
You can’t perform that action at this time.
0 commit comments