@@ -33,12 +33,6 @@ Syntax
33
33
34
34
The command has the following syntax:
35
35
36
- .. note:: Starting in MongoDB 4.2
37
-
38
- - .. include:: /includes/collMod-note.rst
39
-
40
- - .. include:: /includes/extracts/views-restriction-output-to-disk.rst
41
-
42
36
.. code-block:: javascript
43
37
44
38
db.runCommand(
@@ -171,9 +165,8 @@ Validate Documents
171
165
172
166
.. collflag:: validator
173
167
174
- ``validator`` allows users to specify :doc:`validation rules
175
- or expressions </core/schema-validation>` for a collection.
176
- For more information, see :doc:`/core/schema-validation`.
168
+ ``validator`` allows users to specify :ref:`validation rules
169
+ or expressions <schema-validation-overview>` for a collection.
177
170
178
171
The ``validator`` option takes a document that specifies the
179
172
validation rules or expressions. You can specify the expressions
@@ -226,9 +219,9 @@ Modify Views
226
219
227
220
.. collflag:: viewOn
228
221
229
- The underlying source collection or view for the :doc :`view
230
- </core/ views>`. The view definition is determined by applying the
231
- specified :collflag:`pipeline` to this source.
222
+ The underlying source collection or :ref :`view
223
+ <views-landing-page >`. The view definition is determined by applying
224
+ the specified :collflag:`pipeline` to this source.
232
225
233
226
Required if modifying a view on a MongoDB deployment that is running
234
227
with access control.
@@ -288,10 +281,10 @@ Modify Time Series Collections
288
281
289
282
:ref:`manual-timeseries-automatic-removal`
290
283
291
- .. collflag:: timeseries- granularity
292
-
284
+ .. collflag:: granularity
285
+
293
286
To modify the :ref:`granularity <timeseries-granularity>` of a time
294
- series collection, change the ``timeseries.granularity`` value :
287
+ series collection, you can increase ``timeseries.granularity`` from a shorter unit of time to a longer one :
295
288
296
289
.. code-block:: javascript
297
290
@@ -300,23 +293,41 @@ Modify Time Series Collections
300
293
timeseries: { granularity: "seconds" || "minutes" || "hours" }
301
294
})
302
295
303
- You cannot decrease granularity. For example, if granularity is set
304
- to ``minutes``, you can increase it to ``hours``, but you cannot
305
- decrease it to ``seconds``.
306
-
307
- The following table shows the maximum time interval included in one bucket of data when using a given ``granularity`` value:
296
+ To update the custom bucketing parameters ``bucketRoundingSeconds``
297
+ and ``bucketMaxSpanSeconds`` instead of ``granularity``, include both
298
+ custom parameters in the ``collMod`` command and set them to the
299
+ same value:
300
+
301
+ .. code-block:: javascript
308
302
309
- .. include:: /includes/table-timeseries-granularity-intervals.rst
303
+ db.runCommand({
304
+ collMod: "weather24h",
305
+ timeseries: {
306
+ bucketRoundingSeconds: "86400",
307
+ bucketMaxSpanSeconds: "86400"
308
+ }
309
+ })
310
+
311
+ You cannot decrease the granularity interval or the custom bucketing
312
+ values.
310
313
311
314
.. important::
315
+
316
+ You cannot downgrade below MongoDB 6.3 if any time series
317
+ collections explicitly specify the custom bucketing parameters
318
+ ``bucketMaxSpanSeconds`` and ``bucketRoundingSeconds``. If
319
+ possible, convert to the corresponding ``granularity``. If you
320
+ cannot, you must drop the collection before downgrading.
321
+
322
+ To convert a collection from custom bucketing to a ``granularity``,
323
+ value, both ``bucketMaxSpanSeconds`` and ``bucketRoundingSeconds``
324
+ must be less than or equal to the ``granularity`` equivalent:
312
325
313
- As with all :ref:`system collections
314
- <metadata-system-collections>`, do not run any operations on the
315
- underlying ``system.buckets`` collection.
326
+ .. include:: /includes/table-timeseries-granularity-maxspan-rounding-limits.rst
316
327
317
328
.. seealso::
318
329
319
- :ref:`timeseries-granularity`
330
+ :ref:`timeseries-granularity`
320
331
321
332
.. _resize-capped-collection:
322
333
@@ -403,8 +414,8 @@ To disable change stream pre- and post-images for a collection, set
403
414
Write Concern
404
415
~~~~~~~~~~~~~
405
416
406
- Optional. A document expressing the :doc :`write concern
407
- </reference/ write-concern>` of the ``collMod`` command.
417
+ Optional. A document expressing the :ref :`write concern
418
+ <write-concern>` of the ``collMod`` command.
408
419
409
420
Omit to use the default write concern.
410
421
@@ -482,10 +493,10 @@ Hide an Index from the Query Planner
482
493
483
494
To hide an index, you must have :ref:`featureCompatibilityVersion
484
495
<view-fcv>` set to ``4.4`` or greater. However, once hidden, the
485
- index remains hidden even with :ref:` featureCompatibilityVersion
486
- <view-fcv>` set to ``4.2`` on MongoDB 4.4 binaries.
496
+ index remains hidden even with `` featureCompatibilityVersion``
497
+ set to ``4.2`` on MongoDB 4.4 binaries.
487
498
488
- The following example :doc :`hides </core/ index-hidden>` an existing
499
+ The following example :ref :`hides <index-type -hidden>` an existing
489
500
index on the ``orders`` collection. Specifically, the operation hides
490
501
the index with the specification ``{ shippedDate: 1 }`` from the query
491
502
planner.
@@ -519,7 +530,7 @@ To hide a text index, you must specify the index by ``name`` and not by
519
530
520
531
.. seealso::
521
532
522
- - :doc:`/core/ index-hidden`
533
+ - :ref:` index-type -hidden`
523
534
- :method:`db.collection.hideIndex()`
524
535
- :method:`db.collection.unhideIndex()`
525
536
0 commit comments