-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.0.19
-
Component/s: None
-
Query 2020-09-21
$mod treats it's divisor and remainder arguments as int values. This could lead to unexpected behaviour when these arguments are larger than int. For example:
> db.createCollection('test')
> db.test.insert([{a: 4000000000}])
> db.test.find({a: {$mod: [4000000000, 0]}})
The last query should return the single record from the test collection, but returns nothing instead.
- duplicates
-
SERVER-32960 $mod has inconsistent rounding/truncation behavior
- Closed