Skip to content

Commit b6010e8

Browse files
author
Dave Cuthbert
authored
DOCS-15241 constant folding and commutativity (#2532)
* DOCS-15241 constant folding and commutativity * DOCS-15241 constant folding and commutativity * DOCS-15241 constant folding and commutativity * DOCS-15241 constant folding and commutativity * DOCS-15241 constant folding and commutativity * DOCS-15241 constant folding and commutativity * Review feedback
1 parent 4f2832e commit b6010e8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

source/reference/operator/aggregation/add.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ Definition
3030
either all numbers or to numbers and a date. For more information on
3131
expressions, see :ref:`aggregation-expressions`.
3232

33+
Starting in MongoDB 6.1 you can optimize the ``$add`` operation. To
34+
improve performance, group references at the end of the argument
35+
list. For example,
36+
37+
.. code-block:: javascript
38+
39+
$add: [ 1, 2, 3, '$a', '$b', '$c' ]
40+
3341
Examples
3442
--------
3543

source/reference/operator/aggregation/multiply.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ Definition
2828
<aggregation-expressions>` as long as they resolve to numbers. For
2929
more information on expressions, see :ref:`aggregation-expressions`.
3030

31+
Starting in MongoDB 6.1 you can optimize the ``$multiply`` operation.
32+
To improve performance, group references at the end of the argument
33+
list. For example,
34+
35+
.. code-block:: javascript
36+
37+
$multiply: [ 1, 2, 3, '$a', '$b', '$c' ]
38+
3139
Example
3240
-------
3341

0 commit comments

Comments
 (0)