[SERVER-55386] Support hex conversion and binary operators to aggregation framework Created: 21/Mar/21 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Query Language |
| Affects Version/s: | 4.4.4 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Wernfried Domscheit | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||
| Participants: | |||||||||||||
| Case: | (copied to CRM) | ||||||||||||
| Description |
|
Are there any roadmaps to support number to hex conversion and binary operators? I can imagine several use cases where they would be really helpful. Typically and most required operations would be:
Here are some examples:
|
| Comments |
| Comment by owais ahmad [ 15/May/21 ] | |
|
Being new to mongoDB I thought i was doing something wrong, I was surprised string conversion was included. In my application, the values are stored in hexadecimal values encoded as strings starting with 0x. e.g. "0xAEF" (notation in C-language). | |
| Comment by Wernfried Domscheit [ 24/Mar/21 ] | |
|
Hi kyle.suarez I was also considering this but then I skipped it. Converting from Hex to Octal or Binary and vice versa is very simple, so I did not add it to the request. But yes, it could be useful. Base numbers other than 2,8,10,16 should be very exotic I assume.
Best Regards
| |
| Comment by Kyle Suarez [ 24/Mar/21 ] | |
|
Hello wernfried.domscheit@sunrise.net, Thanks for filing this feature request. I'm adding this to the Query Team's backlog, where we will schedule this along with other project work in a future planning meeting. I've also linked SERVER-35013, where we suggest adding integer base conversion support to $convert, which seems like a good feature that should be considered alongside the logical bindata operators suggested here. Best, | |
| Comment by Wernfried Domscheit [ 22/Mar/21 ] | |
|
Yes, i know. However, there is nothing which exist in the Aggregation Framework. That's what I am asking for. | |
| Comment by Eric Sedor [ 22/Mar/21 ] | |
|
Hi wernfried.domscheit@sunrise.net, $bit provides some of this functionality for integer fields. I will pass this ticket on to a team that can comment in more detail. | |
| Comment by Wernfried Domscheit [ 21/Mar/21 ] | |
|
AND, OR, XOR, NOT might be also useful for integer values, not only BinData. However with `$fromHex` and `$toHex` it would be very simple to build them. Example:
|