[SERVER-50579] $mod truncates divisor and remainder to int value Created: 27/Aug/20 Updated: 28/Oct/20 Resolved: 09/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.0.19 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Nikita Lapkov (Inactive) | Assignee: | Nikita Lapkov (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | neweng, qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Sprint: | Query 2020-09-21 | ||||||||
| Participants: | |||||||||
| Description |
|
$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') The last query should return the single record from the test collection, but returns nothing instead. |
| Comments |
| Comment by Nikita Lapkov (Inactive) [ 09/Sep/20 ] | ||||||
|
We have decided to mergeĀ | ||||||
| Comment by Asya Kamsky [ 01/Sep/20 ] | ||||||
|
Note that using $expr and aggregation expression this seems to work correctly:
|