@@ -12,12 +12,175 @@ Compatibility Changes in MongoDB 6.0 (Release Candidate)
12
12
13
13
.. include:: /includes/in-dev.rst
14
14
15
- The following 6.0 changes can affect compatibility with older
16
- versions of MongoDB.
15
+ This page describes changes introduced in MongoDB 6.0 that can affect
16
+ compatibility with older versions of MongoDB.
17
+
18
+ MongoDB 6.0 is a |lts| Release, which means that it is supported for
19
+ both MongoDB Atlas and on-premises deployments. MongoDB 6.0 encompasses
20
+ changes introduced in MongoDB Rapid Releases 5.1, 5.2, and 5.3. This
21
+ page describes compatibility changes introduced in those Rapid Releases
22
+ and MongoDB 6.0.
23
+
24
+ To learn more about the differences between |lts| and Rapid releases,
25
+ see :ref:`release-version-numbers`.
26
+
27
+ Aggregation
28
+ -----------
29
+
30
+ ``$setWindowFields`` Transactions and Snapshot Read Concern
31
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32
+
33
+ .. include:: /includes/fact-5.1-setWindowFields-snapshot-restriction.rst
34
+
35
+
36
+ Change Streams
37
+ --------------
38
+
39
+ .. include:: /includes/change-streams-and-orphans.rst
40
+
41
+ Indexes
42
+ -------
43
+
44
+ Existing Indexes Can Be Dropped During an Index Build
45
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46
+
47
+ Starting in MongoDB 5.2, you can use :dbcommand:`dropIndexes` or
48
+ :method:`db.collection.dropIndexes()` to drop existing indexes on the
49
+ same collection even if there is an index build in progress. In earlier
50
+ versions, attempting to drop a different index during an in-progress
51
+ index build results in a ``BackgroundOperationInProgressForNamespace``
52
+ error.
53
+
54
+ 2dsphere Document Index Keys
55
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56
+
57
+ To prevent out of memory errors,
58
+ :parameter:`indexMaxNumGeneratedKeysPerDocument` limits the maximum
59
+ number of :ref:`2dsphere index keys <geo-2dsphere>` generated for a
60
+ single document.
61
+
62
+ See :parameter:`indexMaxNumGeneratedKeysPerDocument`.
63
+
64
+ Platform Support
65
+ ----------------
66
+
67
+ Starting in MongoDB 5.1.2 the following platforms are no longer
68
+ supported:
69
+
70
+ Community Edition
71
+ ~~~~~~~~~~~~~~~~~
72
+
73
+ - :abbr:`RHEL (Red Hat Enterprise Linux)`-72-s390x
74
+
75
+ Removed Operators
76
+ -----------------
77
+
78
+ Starting in MongoDB 5.1, these operators are removed:
79
+
80
+ .. list-table::
81
+ :header-rows: 1
82
+
83
+ * - Removed Operator
84
+ - Alternative
85
+ * - $comment
86
+ - :method:`cursor.comment()`
87
+ * - $explain
88
+ - :method:`cursor.explain()`
89
+ * - $hint
90
+ - :method:`cursor.hint()`
91
+ * - $max
92
+ - :method:`cursor.max()`
93
+ * - $maxTimeMS
94
+ - :method:`cursor.maxTimeMS()`
95
+ * - $min
96
+ - :method:`cursor.min()`
97
+ * - $orderby
98
+ - :method:`cursor.sort()`
99
+ * - $query
100
+ - See :ref:`doc-cursor-methods`
101
+ * - $returnKey
102
+ - :method:`cursor.returnKey()`
103
+ * - $showDiskLoc
104
+ - :method:`cursor.showRecordId()`
105
+ * - ``db.getLastError()``
106
+ - See :ref:`legacy-op-codes-removed`
107
+ * - ``db.getLastErrorObj()``
108
+ - See :ref:`legacy-op-codes-removed`
109
+ * - ``getLastError``
110
+ - See :ref:`legacy-op-codes-removed`
111
+
112
+ Removed Options
113
+ ---------------
114
+
115
+ MongoDB 6.0 removes the ``--cpu`` :binary:`~bin.mongod` option.
116
+
117
+ Removed Parameters
118
+ ------------------
119
+
120
+ MongoDB 6.0 removes the following server parameters:
121
+
122
+ .. list-table::
123
+ :header-rows: 1
124
+ :widths: 25 75
125
+
126
+ * - Removed Parameter
127
+ - Description
128
+
129
+ * - :option:`--tlsFIPSMode <mongod --tlsFIPSMode>`
130
+ - This option is removed from the MongoDB Community Edition. It
131
+ is available in MongoDB Enterprise edition.
132
+
133
+ FIPS was not a supported feature in MongoDB Community Edition.
134
+ If your installation made use of FIPS anyway, you will need to
135
+ :doc:`reconfigure your TLS/SSL connections </tutorial/configure-ssl>`
136
+ before upgrading.
137
+
138
+ Replica Sets
139
+ ------------
140
+
141
+ Assert Cluster Wide Write Concern is Set When Starting or Adding Shard
142
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143
+
144
+ .. include:: /includes/fact-5.1-fassert-shard-restart-add-CWWC.rst
145
+
146
+ ``rs.reconfig`` Cluster Wide Write Concern Validation
147
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148
+
149
+ .. include:: /includes/fact-5.1-reconfig-CWWC-validation.rst
150
+
151
+ Arbiters
152
+ ~~~~~~~~
153
+
154
+ .. include:: /includes/5.1/fact-do-not-use-with-quarterlies.rst
155
+
156
+ Security
157
+ --------
158
+
159
+ Intra-Cluster Authentication
160
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161
+
162
+ .. include:: /includes/intra-cluster-authentication.rst
163
+
164
+ FIPS Mode Defaults SCRAM-SHA-1 Authentication to Off
165
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166
+
167
+ .. include:: /includes/fact-5.1-scram-sha-1-fips-default.rst
17
168
18
169
Time Series Collections
19
170
-----------------------
20
171
172
+ .. warning::
173
+
174
+ If you create a sharded :ref:`time series collection
175
+ <manual-timeseries-collection>` in MongoDB 5.1 or greater, downgrading
176
+ to a version older than MongoDB 5.0.4 will result in data loss.
177
+
178
+ Before downgrading to a version older than 5.0.4, drop all sharded
179
+ time series collections.
180
+
181
+ Secondary Indexes on Time Series Collections
182
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183
+
21
184
.. include:: /includes/time-series-secondary-indexes-downgrade-FCV.rst
22
185
23
186
General Changes
@@ -42,3 +205,91 @@ Deprecations
42
205
* - :dbcommand:`reIndex`
43
206
44
207
- The :dbcommand:`reIndex` command is deprecated in MongoDB v6.0.
208
+
209
+ ``$regex`` Find Queries No Longer Ignore Invalid Regex
210
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211
+
212
+ .. include:: /includes/fact-5.1-regex-find-functionality.rst
213
+
214
+ ``$regex`` Schema Validation Error Behavior
215
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216
+
217
+ .. include:: /includes/fact-5.1-regex-document-schema-validation.rst
218
+
219
+ ``$mod`` Error Behavior
220
+ ~~~~~~~~~~~~~~~~~~~~~~~
221
+
222
+ Starting in MongoDB 5.1 (and 5.0.4 and 4.4.10), the :query:`$mod`
223
+ operator returns an error if the ``divisor`` or ``remainder`` values
224
+ evaluate to certain values. See :ref:`$mod behavior <mod-behavior>`.
225
+
226
+ .. _legacy-op-codes-removed:
227
+
228
+ Legacy Opcodes Removed
229
+ ~~~~~~~~~~~~~~~~~~~~~~
230
+
231
+ MongoDB drivers have used :ref:`OP_MSG <wire-op-msg>` instead of
232
+ :ref:`OP_QUERY <wire-op-query>` and the other legacy opcodes since
233
+ MongoDB v3.6.
234
+
235
+ This release removes support for the following legacy opcodes:
236
+
237
+ - :ref:`OP_INSERT <wire-op-insert>`
238
+ - :ref:`OP_DELETE <wire-op-delete>`
239
+ - :ref:`OP_UPDATE <wire-op-update>`
240
+ - :ref:`OP_KILL_CURSORS <wire-op-kill-cursors>`
241
+ - :ref:`OP_GET_MORE <wire-op-get-more>`
242
+ - :ref:`OP_QUERY <wire-op-query>`
243
+
244
+ To avoid disruption due to the removal of these op codes, please
245
+ upgrade your driver to the latest version.
246
+
247
+ :binary:`mongod` will close the connection and will not respond to:
248
+
249
+ - :ref:`OP_INSERT <wire-op-insert>`
250
+ - :ref:`OP_DELETE <wire-op-delete>`
251
+ - :ref:`OP_UPDATE <wire-op-update>`
252
+ - :ref:`OP_KILL_CURSORS <wire-op-kill-cursors>`
253
+
254
+ :binary:`mongod` will return an error for:
255
+
256
+ - :ref:`OP_GET_MORE <wire-op-get-more>`
257
+ - :ref:`OP_QUERY <wire-op-query>` legacy find
258
+
259
+ The :ref:`OP_QUERY <wire-op-query>` RPC protocol may be used with the
260
+ following commands:
261
+
262
+ - ``_isSelf``
263
+ - ``authenticate``
264
+ - ``buildinfo``
265
+ - ``buildInfo``
266
+ - ``hello``
267
+ - ``ismaster``
268
+ - ``isMaster``
269
+ - ``saslContinue``
270
+ - ``saslStart``
271
+
272
+ :ref:`OP_QUERY <wire-op-query>` will return an error if it is used for
273
+ a find operation. All other commands will be rejected if issued as
274
+ :ref:`OP_QUERY <wire-op-query>`.
275
+
276
+ If you attempt to connect to a MongoDB 3.4, or older, :binary:`mongod`
277
+ instance with a MongoDB 5.1 or newer :binary:`~bin.mongo` shell, you
278
+ will receive an error message like the following:
279
+
280
+ .. code-block:: javascript
281
+ :copyable: false
282
+
283
+ // Reformated for clarity. The message appears on a single line.
284
+
285
+ Connection handshake failed. Is your mongod 3.4 or older?
286
+ :: caused by :: network error while attempting to run command
287
+ 'isMaster' on host '127.0.0.1:27017'
288
+
289
+ Default ``db.stats()`` Settings
290
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291
+
292
+ Starting in MongoDB 6.0, the :dbcommand:`dbStats` command and the
293
+ :method:`db.stats()` method only report free space assigned to
294
+ collections if the :ref:`freeStorage <dbStats-freeStorage>` parameter is
295
+ set to 1.
0 commit comments