Last active
March 2, 2018 15:54
-
-
Save tradingbills/7203b64ec7d5f16baa429472af07b6cf to your computer and use it in GitHub Desktop.
Signedup and Paid within dateRange, Count
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
var collName= 20180302 | |
// 2018-03-02 00:00:00 to | |
// 2018-03-02 23:59:59 | |
var dateRange= {"$gte":1519948800,"$lte":1520035199} | |
var queryDoc; queryDoc.signed_up_at = dateRange | |
var paid = "59deb60085a3c22795133b02" | |
var free = "59dfe40a0a5037ff1c0bd8af" | |
queryDoc["segments.segments.id"] = paid; | |
db.getCollection(`${collName}`).aggregate([{"$match": queryDoc} | |
,{"$group": {"_id": null, | |
"Array Value for Paid and Signed up, by date range": {"$sum": 1}, | |
} } | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment