[SERVER-29512] Convert an ObjectId to a hex string in aggregation pipeline stages Created: 08/Jun/17 Updated: 06/Apr/23 Resolved: 02/Mar/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andrew Harris | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
At the moment if you need to concatenate two ObjectIds into a single string value then this has to be done outside AP (in Java code, etc). What would be really handy is if there was so sort of $toString function that converts anything to a String representation or if you wanted to cut down the scope for now then expand the $concat function to internally convert ObjectIds to their hex string representation during the concat operation. |
| Comments |
| Comment by Asya Kamsky [ 02/Mar/18 ] |
|
See this comment for how this will work: |
| Comment by Andrew Harris [ 20/Dec/17 ] |
|
So that will be 3.8 then? A long way off I suspect. |
| Comment by Asya Kamsky [ 08/Dec/17 ] |
|
aharris yes, we are currently planning on delivering type conversion functionality (including this one) for the next major release. |
| Comment by Andrew Harris [ 08/Dec/17 ] |
|
Is this improvement still be considered at all? |
| Comment by Samuel Marks [X] [ 06/Nov/17 ] |
|
Agreed, my use-case I need to combine `ObjectId` for a new 'primary key' |
| Comment by Andrew Harris [ 26/Oct/17 ] |
|
Any update on this? I was hoping to see this as part of the 3.6 release changes. |
| Comment by Asya Kamsky [ 25/Jun/17 ] |
|
aharris However, we are already considering specifically ObjectId to hex string since multiple MongoDB drivers provide that exact conversion function. We need to reach consensus on syntax for these type conversion functions and we are working on that now. |
| Comment by Andrew Harris [ 13/Jun/17 ] |
|
More of an expansion on |
| Comment by Dissatisfied Former User [ 12/Jun/17 ] |
|
Potential duplicate of |
| Comment by David Storch [ 08/Jun/17 ] |
|
Hi aharris, thanks for the feature request. We are sending this request to the Query Team for triage. |