Created
July 2, 2017 21:43
-
-
Save charlesBochet/cdce156784d3028225ac0dba0264ba98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
'$project': { | |
'quarterStart': { | |
'$subtract': [ | |
'$timestamp', | |
{ | |
'$add': [ | |
{ | |
'$multiply': [ | |
{ | |
'$mod': [ # $minutes mod 15 | |
{ | |
'$minute': '$timestamp' | |
}, | |
15 | |
] | |
}, | |
1000, | |
60 | |
] | |
}, | |
{ | |
'$multiply': [ | |
{ | |
'$second': '$timestamp' | |
}, | |
1000 | |
] | |
}, | |
{ | |
'$millisecond': '$timestamp' | |
}, | |
] | |
} | |
] | |
}, | |
'recipients': 1, | |
'client_code': 1 | |
}, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment