Last active
March 2, 2018 15:52
-
-
Save tradingbills/13e97e44bf8ef64819565bb4d7c0d57b to your computer and use it in GitHub Desktop.
Signedup and Paid within dateRange, Itemized who and what
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= 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" | |
| var segPaidOrFree = paid | |
| queryDoc["segments.segments.id"] = segPaidOrFree; | |
| db.getCollection(`${collName}`).aggregate([{"$match": queryDoc} | |
| ,{ $project: { "_id":0, | |
| "Plan Names": "$custom_attributes.api_plan_name", | |
| "User id": "$user_id", | |
| "User email": "$email" | |
| } } | |
| ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment