[SERVER-32961] Add $fmod, or some way to mod by fractional numbers, to the match expression language Created: 29/Jan/18 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | expression, mql-semantics | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
The $mod query operator converts fractional numbers to integers to do the modular arithmetic. It still makes sense to mod by a fractional number in some scenarios. |
| Comments |
| Comment by David Storch [ 30/Jan/18 ] | ||||
|
geert.bosch, if I understand correctly, this ticket is specifically about the match expression language, not the agg expression language. I've updated the title of the ticket to clarify. | ||||
| Comment by Geert Bosch [ 30/Jan/18 ] | ||||
|
Actually, it seems $mod aggregation operator does support fractional numbers:
The ExpressionMod code looks correct as well. | ||||
| Comment by David Storch [ 29/Jan/18 ] | ||||
|
As part of JSON Schema, we implemented internal support for fmod in the match expression language: $_internalSchemaFmod: Assuming this implements the behavior we want in general, we could change this to be exposed to clients. | ||||
| Comment by Charlie Swanson [ 29/Jan/18 ] | ||||
|
geert.bosch can you elaborate on the use case you were describing earlier? Not sure I followed enough to summarize myself |