[SERVER-16418] Add a way to convert a number or string value(s) to a date in $project Created: 04/Dec/14 Updated: 05/Dec/14 Resolved: 05/Dec/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Matt Kalan | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
A very common data management pattern is to do ELT - e.g. extract data (e.g. from an RDBMS), load it (into MongoDB), and then transform it in MongoDB [with $out to another collection], instead of having to transform it in files or via ETL tools. The aggregation framework would be much better at this if it could convert dates (and other types in other JIRA tickets). One situation I worked on is taking a file with dates as numbers like 20140101 but it would also have been easy to put quotes around that in the files and use $substr to pull out the year, month, and day from "20140101" but there was no way to take those values and project it to a date value |
| Comments |
| Comment by Ramon Fernandez Marina [ 05/Dec/14 ] |
|
I think |
| Comment by Matt Kalan [ 04/Dec/14 ] |
|
Didn't see that one browsing the many tickets in this area but it is close. I'm also suggesting converting a number to a date (either a number that looks like 20140101 for Jan 1 2014, or seconds from epoch. |
| Comment by Matt Kangas [ 04/Dec/14 ] |
|
Dup of |