Skip to content

Instantly share code, notes, and snippets.

@zubair1024
Last active June 11, 2020 18:44
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 zubair1024/4abe05c67d33ad16944517f00ec82c1c to your computer and use it in GitHub Desktop.
Save zubair1024/4abe05c67d33ad16944517f00ec82c1c to your computer and use it in GitHub Desktop.
db.livepolicies.aggregate()
.match({
masterGroupID1Count: {
$exists: true
}
})
.project({
'DateString': {
$dateToString: {
format:'%Y-%m-%d',
timezone: "Europe/London",
date: '$etlDate'
}
},
'Boiler': '$masterGroupID1Count',
'Appliance': '$masterGroupID2Count',
'Home Emergency': '$masterGroupID3Count',
'Car': '$masterGroupID4Count',
})
.sort({ etlDate: -1 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment