Skip to content

Instantly share code, notes, and snippets.

@charlesBochet
Created July 2, 2017 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlesBochet/cdce156784d3028225ac0dba0264ba98 to your computer and use it in GitHub Desktop.
Save charlesBochet/cdce156784d3028225ac0dba0264ba98 to your computer and use it in GitHub Desktop.
{
'$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