File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
source/reference/operator Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1818 db.inventory.find( { qty: { $mod: [ 4, 0 ] } } )
1919
2020 This query will select all documents in the ``inventory`` collection
21- where the ``qty`` field value modulo ``4`` equals ``3 ``, such as
21+ where the ``qty`` field value modulo ``4`` equals ``0 ``, such as
2222 documents with ``qty`` value equal to ``0`` or ``12``.
2323
2424 In some cases, you can query using the :operator:`$mod` operator
2727
2828 .. code-block:: javascript
2929
30- db.inventory.find( { qty: { $mod: [ 4, 3 ] } } )
30+ db.inventory.find( { qty: { $mod: [ 4, 0 ] } } )
3131
3232 The above query is less expensive than the following query which
3333 uses the :operator:`$where` operator:
3434
3535 .. code-block:: javascript
3636
37- db.inventory.find( { $where: "this.qty % 4 == 3 " } )
37+ db.inventory.find( { $where: "this.qty % 4 == 0 " } )
3838
3939 .. seealso::
4040
You can’t perform that action at this time.
0 commit comments