[SERVER-12043] $unixDays, $unixYears, $unixHours like operator for Date Aggregation Operators Created: 11/Dec/13  Updated: 25/Jun/15  Resolved: 20/May/15

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Trivial - P5
Reporter: Vladimir 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-6239 Better semantics for $add and $subtra... Closed
Participants:

 Description   

As in Summary* would be very usefull to take some calculation aware processes around ISODate in pipeline.

As for me. At this point I can not calculate difference between two dates in days at pipeline without casting 2xMath operators on dates each time.

So, whould be great to consider some quick casting. Naming is pretty obvious.



 Comments   
Comment by Charlie Swanson [ 20/May/15 ]

We added support for subtracting two Dates to get the milliseconds elapsed between them in SERVER-6239. That combined with $divide should be able to convert to hours (60*60*1000) or days (86400*1000). If there is something else you need, please reopen with an example usage.

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