File tree Expand file tree Collapse file tree 4 files changed +18
-12
lines changed
rails/generators/mongoid/config/templates Expand file tree Collapse file tree 4 files changed +18
-12
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
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ module Config
23
23
# database name is not explicitly defined.
24
24
option :app_name , default : nil
25
25
26
- # Create indexes in background by default.
26
+ # (Deprecated) In MongoDB 4.0 and earlier, set whether to create
27
+ # indexes in the background by default. (default: false)
27
28
option :background_indexing , default : false
28
29
29
30
# Mark belongs_to associations as required by default, so that saving a
Original file line number Diff line number Diff line change @@ -120,9 +120,6 @@ development:
120
120
# database name is not explicitly defined. (default: nil)
121
121
# app_name: MyApplicationName
122
122
123
- # Create indexes in background by default. (default: false)
124
- # background_indexing: false
125
-
126
123
# Mark belongs_to associations as required by default, so that saving a
127
124
# model with a missing belongs_to association will trigger a validation
128
125
# error. (default: true)
@@ -167,6 +164,10 @@ development:
167
164
# (default: false)
168
165
# use_utc: false
169
166
167
+ # (Deprecated) In MongoDB 4.0 and earlier, set whether to create
168
+ # indexes in the background by default. (default: false)
169
+ # background_indexing: false
170
+
170
171
test :
171
172
clients :
172
173
default :
You can’t perform that action at this time.
0 commit comments