Last active
April 19, 2018 20:38
-
-
Save tradingbills/23fa4bb5e77a947cb34246fe3dec06a3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var collName= 20180419 | |
// 2018-04-18 00:00:00 to | |
// 2018-04-18 23:59:59 | |
var dateRange= {"$gte":1524009600,"$lte":1524095999} | |
// ----------------------------------------------------- | |
var queryDoc040506={}; queryDoc040506.signed_up_at = dateRange | |
db.getCollection(`${collName}`) | |
.aggregate([ { $match: { signed_up_at: dateRange } } ,{ $group: { _id : "$custom_attributes.api_experience_level",/*'Plan Names': { $addToSet: { api_plan_name : "$custom_attributes.api_plan_name"}}, */ "Sum" : {"$sum":1} } } ,{ $sort:{_id : 1} } ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment