[SERVER-23347] Date difference operator Created: 25/Mar/16 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | James Moger | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Optimization
|
||||||||
| Participants: | |||||||||
| Description |
|
It would be really nice to have a flexible date difference operator that calculates the difference between two dates resulting in a duration (e.g. duration in msecs, secs, mins, hours, etc). Consider the following projection stage in an aggregation pipeline. I need to calculate the difference in days between two dates - and one date may be null.
This works - and it's fast - but it would be more pleasant if I could specify something like:
ArangoDB offers a date difference function which is pretty nice,
|
| Comments |
| Comment by Asya Kamsky [ 08/Jan/20 ] | |||||||||||||||||
|
A user at a local event asked for this as they calculate age many times and it would be simple and very readable to see
than what people are currently using
| |||||||||||||||||
| Comment by Ramon Fernandez Marina [ 18/May/16 ] | |||||||||||||||||
|
Thanks for the clarification jamesmoger; while I think it makes sense for this request to be addressed at the same time as Regards, | |||||||||||||||||
| Comment by James Moger [ 16/May/16 ] | |||||||||||||||||
|
My request is similar, but not the same.
| |||||||||||||||||
| Comment by Ian Whalen (Inactive) [ 06/May/16 ] | |||||||||||||||||
|
Hi James, we believe this is a dupe of | |||||||||||||||||
| Comment by Ramon Fernandez Marina [ 25/Mar/16 ] | |||||||||||||||||
|
Thanks for your suggestion jamesmoger, it has been sent to the Query team for evaluation. Please continue to watch this ticket for updates. Regards, |