File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 21
21
22
22
{ field: { $mod: [ divisor, remainder ] } }
23
23
24
+ .. _mod-behavior:
25
+
24
26
Behavior
25
27
--------
26
28
27
- The :query:`$mod` operator returns an error if the:
28
-
29
- - ``[ divisor, remainder ]`` array contains fewer or more than
30
- two elements. For examples, see :ref:`mod-not-enough-elements` and
31
- :ref:`mod-too-many-elements` respectively.
29
+ The :query:`$mod` operator returns an error if the ``[ divisor,
30
+ remainder ]`` array contains fewer or more than two elements. For
31
+ examples, see :ref:`mod-not-enough-elements` and
32
+ :ref:`mod-too-many-elements` respectively.
32
33
33
- - ``divisor`` or ``remainder`` values evaluate to:
34
+ Also, starting in MongoDB 5.1 (and 5.0.4 and 4.4.10), :query:`$mod`
35
+ returns an error if the ``divisor`` or ``remainder`` values evaluate to:
34
36
35
- - ``NaN`` (not a number) or ``Infinity``.
37
+ - ``NaN`` (not a number) or ``Infinity``.
36
38
37
- - A value that cannot be represented using a 64-bit integer.
39
+ - A value that cannot be represented using a 64-bit integer.
38
40
39
41
Examples
40
42
--------
Original file line number Diff line number Diff line change @@ -68,6 +68,13 @@ Auditing
68
68
General Changes
69
69
---------------
70
70
71
+ ``$mod`` Error Behavior
72
+ ~~~~~~~~~~~~~~~~~~~~~~~
73
+
74
+ Starting in MongoDB 5.1 (and 5.0.4 and 4.4.10), the :query:`$mod`
75
+ operator returns an error if the ``divisor`` or ``remainder`` values
76
+ evaluate to certain values. See :ref:`$mod behavior <mod-behavior>`.
77
+
71
78
Deprecations
72
79
------------
73
80
You can’t perform that action at this time.
0 commit comments