[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:
Duplicate
duplicates SERVER-4434 aggregation: add strptime functional... Closed
Related
related to SERVER-5239 $project should have numeric type coe... Closed
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 SERVER-4434 would definitely address this ticket, so I'm resolving it as a duplicate.

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 SERVER-4434? Also related is SERVER-9626

Generated at Thu Feb 08 03:40:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.