You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/reference/command/create.txt
+78-16Lines changed: 78 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -28,11 +28,6 @@ Syntax
28
28
29
29
The :dbcommand:`create` command has the following syntax:
30
30
31
-
.. note:: Starting in MongoDB 4.2
32
-
33
-
MongoDB removes the MMAPv1 storage engine and the MMAPv1 specific
34
-
option ``flags`` for :dbcommand:`create`.
35
-
36
31
.. code-block:: javascript
37
32
38
33
db.runCommand(
@@ -42,7 +37,9 @@ The :dbcommand:`create` command has the following syntax:
42
37
timeseries: {
43
38
timeField: <string>,
44
39
metaField: <string>,
45
-
granularity: <string>
40
+
granularity: <string>,
41
+
bucketMaxSpanSeconds: <int>,
42
+
bucketRoundingSeconds: <int>
46
43
},
47
44
expireAfterSeconds: <number>,
48
45
clusteredIndex: <document>, // Added in MongoDB 5.3
@@ -107,27 +104,74 @@ The :dbcommand:`create` command has the following fields:
107
104
108
105
* - ``timeseries.granularity``
109
106
- string
110
-
- Optional. Possible values are ``"seconds"`` (default),
111
-
``"minutes"``, and ``"hours"``. Set the granularity to the value
112
-
that is the closest match to the time span between consecutive
113
-
incoming measurements. Setting the ``granularity`` parameter
114
-
accurately improves performance by optimizing how data in the time
115
-
series collection is stored internally.
107
+
108
+
- Optional. Defaults to ``"seconds"`` if unset. If you set
109
+
``granularity`` you must not set ``bucketMaxSpanSeconds`` or ``bucketRoundingSeconds``. Possible values are ``"seconds"`` (default),``"minutes"``, and ``"hours"``.
110
+
111
+
Set the granularity to the value that is the
112
+
closest match to the time span between consecutive incoming
113
+
measurements. Setting the ``granularity`` parameter accurately
114
+
improves performance by optimizing how data in the time series
115
+
collection is stored internally.
116
+
117
+
For more information on how granularity settings differ, see
0 commit comments