@@ -34,20 +34,31 @@ Definition
34
34
Syntax
35
35
------
36
36
37
+ .. versionchanged:: 7.0
38
+
37
39
The command has the following syntax:
38
40
39
41
.. code-block:: javascript
40
42
41
43
db.adminCommand(
42
44
{
43
45
setFeatureCompatibilityVersion: <version>,
46
+ confirm: true
44
47
writeConcern: { wtimeout: <timeout> }
45
48
}
46
49
)
47
50
48
51
Command Fields
49
52
--------------
50
53
54
+ The ``setFeatureCompatibilityVersion`` command takes the following
55
+ fields:
56
+
57
+ setFeatureCompatibilityVersion
58
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59
+
60
+ *Required*
61
+
51
62
The possible values for ``version`` are:
52
63
53
64
.. list-table::
@@ -57,8 +68,14 @@ The possible values for ``version`` are:
57
68
* - Version
58
69
- Description
59
70
71
+ * - ``"7.0"``
72
+ - *Available on MongoDB 7.0 Deployments*
73
+
74
+ Enables the :ref:`7.0 features that persist data incompatible
75
+ with MongoDB 6.0 <7.0-downgrade-considerations>`.
76
+
60
77
* - ``"6.0"``
61
- - *Available on MongoDB 6.0 Deployments*
78
+ - *Available on MongoDB 6.0 and 7.0 Deployments*
62
79
63
80
Enables the :ref:`6.0 features that persist data incompatible
64
81
with MongoDB 5.0 <6.0-downgrade-considerations>`.
@@ -76,17 +93,33 @@ The possible values for ``version`` are:
76
93
with MongoDB 4.2 <4.4-compatibility-enabled>`.
77
94
78
95
* - ``"4.2"``
79
- - *Available on MongoDB 4.2 and 4.4 Deployments*
96
+ - *Available on MongoDB 4.4 Deployments*
97
+
98
+ Disables the :ref:`4.4 features that persist data incompatible
99
+ with MongoDB 4.2 <4.4-compatibility-enabled>`.
100
+
101
+ confirm
102
+ ~~~~~~~
80
103
81
- Enables the :ref:`4.2 features that persist data incompatible
82
- with MongoDB 4.0 <4.2-compatibility-enabled>`.
104
+ *Required*
83
105
84
- - If set on MongoDB 4.4 deployments,
85
- Disables the :ref:`4.4 features that persist data
86
- incompatible with MongoDB 4.2
87
- <4.4-compatibility-enabled>`.
106
+ .. versionadded:: 7.0
88
107
89
- The optional ``writeConcern`` specifies the write concern
108
+ Set to ``true`` to confirm the feature compatibility change and allow
109
+ the operation to proceed.
110
+
111
+ If you omit the ``confirm`` parameter or set ``confirm`` to a value
112
+ other than ``true``, the command fails and returns a warning about
113
+ modifying the feature compatibility version. The warning states that
114
+ after you upgrade or downgrade your cluster's {+fcv+}, you cannot
115
+ downgrade the binary version without support assistance.
116
+
117
+ writeConcern
118
+ ~~~~~~~~~~~~
119
+
120
+ *Optional*
121
+
122
+ The ``writeConcern`` specifies the write concern
90
123
:ref:`wc-wtimeout` value in milliseconds:
91
124
92
125
- The time period that the :term:`primary` waits for
@@ -105,6 +138,40 @@ The optional ``writeConcern`` specifies the write concern
105
138
Behavior
106
139
--------
107
140
141
+ Downgrade with Backward-Incompatible Data
142
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143
+
144
+ If you try to downgrade the {+fcv+} of a cluster that contains
145
+ incompatible data in the downloaded version, you receive a
146
+ ``CannotDowngrade`` error. When this error occurs, the cluster remains
147
+ in the transitionary ``downgrading`` state.
148
+
149
+ To move the cluster out of the ``downgrading`` state, either:
150
+
151
+ - Modify your cluster data to remove backwards-incompatible features,
152
+ then re-run the ``setFeatureCompatibilityVersion`` command with the
153
+ downgraded version to set the {+fcv+} to the downgraded version.
154
+
155
+ - Run the ``setFeatureCompatibilityVersion`` command with the original
156
+ upgraded version to set the {+fcv+} back to the original version.
157
+
158
+ .. important::
159
+
160
+ Setting the {+fcv+} to the original version stops the downgrade
161
+ procedure and changes the {+fcv+} back to the upgraded version.
162
+ This procedure does not reset the cluster back to the state before
163
+ the {+fcv+} downgrade began.
164
+
165
+ Downgrade Policy Changes in MongoDB 7.0
166
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167
+
168
+ Starting in MongoDB 7.0, you cannot downgrade your deployment's {+fcv+}
169
+ to or from a :ref:`rapid release <rapid-releases>` version of MongoDB.
170
+
171
+ If you upgrade or downgrade your deployment's {+fcv+}, you cannot
172
+ downgrade your deployment's binary version without assistance from
173
+ support.
174
+
108
175
Conflicts with Background Operations
109
176
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110
177
@@ -167,11 +234,12 @@ instance, run the :dbcommand:`getParameter` command on a
167
234
168
235
.. code-block:: javascript
169
236
170
- db.adminCommand( {
171
- getParameter: 1,
172
- featureCompatibilityVersion: 1
173
- }
174
- )
237
+ db.adminCommand(
238
+ {
239
+ getParameter: 1,
240
+ featureCompatibilityVersion: 1
241
+ }
242
+ )
175
243
176
244
The output resembles:
177
245
@@ -200,6 +268,63 @@ The output resembles:
200
268
201
269
.. _set-fcv:
202
270
271
+ Set Feature Compatibility Version on MongoDB 7.0 Deployments
272
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273
+
274
+ Enable 7.0 Backwards Incompatible Features
275
+ ``````````````````````````````````````````
276
+
277
+ To enable the :ref:`7.0 features that persist data incompatible with
278
+ MongoDB 6.0 <7.0-downgrade-incompatible>`, set the feature compatibility
279
+ to ``"7.0"`` on the MongoDB 7.0 deployment:
280
+
281
+ .. note::
282
+
283
+ Run the :dbcommand:`setFeatureCompatibilityVersion` command against
284
+ the ``admin`` database.
285
+
286
+ .. include:: /includes/list-run-command-targets.rst
287
+
288
+ .. code-block:: javascript
289
+
290
+ db.adminCommand(
291
+ {
292
+ setFeatureCompatibilityVersion: "7.0",
293
+ confirm: true
294
+ }
295
+ )
296
+
297
+ Disable 7.0 Backwards Incompatible Features
298
+ ```````````````````````````````````````````
299
+
300
+ To disable the :ref:`7.0 features that persist data incompatible with
301
+ MongoDB 6.0 <7.0-downgrade-incompatible>`, set the feature compatibility
302
+ to ``"6.0"`` on the MongoDB 7.0 deployment:
303
+
304
+ .. note::
305
+
306
+ Run the :dbcommand:`setFeatureCompatibilityVersion` command against
307
+ the ``admin`` database.
308
+
309
+ .. include:: /includes/list-run-command-targets.rst
310
+
311
+ - ``"6.0"`` featureCompatibilityVersion is supported on MongoDB
312
+ 6.0 and MongoDB 7.0 deployments only.
313
+
314
+ .. code-block:: javascript
315
+
316
+ db.adminCommand(
317
+ {
318
+ setFeatureCompatibilityVersion: "6.0",
319
+ confirm: true
320
+ }
321
+ )
322
+
323
+ If run as part of the downgrade process from MongoDB 7.0 to MongoDB
324
+ 6.0, you must also remove all persisted features that are
325
+ :ref:`incompatible <7.0-downgrade-incompatible>` with 6.0. See the
326
+ appropriate downgrade procedures.
327
+
203
328
Set Feature Compatibility Version on MongoDB 6.0 Deployments
204
329
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205
330
@@ -329,9 +454,6 @@ to ``"4.2"`` on the MongoDB 4.4 deployment:
329
454
330
455
.. include:: /includes/list-run-command-targets.rst
331
456
332
- - ``"4.2"`` featureCompatibilityVersion is supported on MongoDB
333
- 4.2 and MongoDB 4.4 deployments only.
334
-
335
457
.. code-block:: javascript
336
458
337
459
db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )
@@ -341,27 +463,6 @@ If run as part of the downgrade process from MongoDB 4.4 to MongoDB
341
463
:ref:`incompatible <4.4-compatibility-enabled>` with 4.2. See the
342
464
appropriate downgrade procedures.
343
465
344
- Set Feature Compatibility Version on MongoDB 4.2 Deployments
345
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
346
-
347
- Enable 4.2 Backwards Incompatible Features
348
- ``````````````````````````````````````````
349
-
350
- To enable the :ref:`4.2 features that persist data incompatible with
351
- MongoDB 4.0 <4.2-compatibility-enabled>`, set the feature compatibility
352
- to ``"4.2"`` on the MongoDB 4.2 deployment:
353
-
354
- .. note::
355
-
356
- Run the :dbcommand:`setFeatureCompatibilityVersion` command against
357
- the ``admin`` database.
358
-
359
- .. include:: /includes/list-run-command-targets.rst
360
-
361
- .. code-block:: javascript
362
-
363
- db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )
364
-
365
466
Set Write Concern Timeout
366
467
~~~~~~~~~~~~~~~~~~~~~~~~~
367
468
0 commit comments