Skip to content

Commit

Permalink
feat(reports): churn report
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreCat committed May 15, 2017
1 parent 5e3e506 commit ba7ff72
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions reports/churned-users.js
@@ -0,0 +1,8 @@
let userCount;
userCount = db.users.count(
{$or:[
{'purchased.txnCount':{$gt:0},$and:[{'auth.timestamps.loggedin':{$gt:new Date('2017-04-01')}},{'auth.timestamps.loggedin':{$lt:new Date('2017-05-01')}}]},
{$and:[{'purchased.plan.dateTerminated':{$type:'date'}},{'purchased.plan.dateTerminated':{$gt:new Date('2017-04-01')}},{'purchased.plan.dateTerminated':{$lt:new Date('2017-05-01')}}]}
]}
);
print(userCount);
1 change: 0 additions & 1 deletion reports/expired-group-plans.js
Expand Up @@ -25,4 +25,3 @@ db.users.find({'_id':{$in:userList}},{'profile.name':1,'auth':1})
}
print('\"' + user.profile.name + '\"' + ',' + '\"' + email + '\"');
});

1 change: 1 addition & 0 deletions reports/guild-count.js
@@ -1,4 +1,5 @@
// How many Guilds are users members of? Outputs counts of users with each number of Guilds
// Run using migration-runner.js

var aggregationCursor = db.users.aggregate(
[
Expand Down
1 change: 1 addition & 0 deletions reports/sound-themes.js
@@ -1,4 +1,5 @@
// How many users use each sound theme? Outputs count of users per theme
// Run using migration-runner.js

var userList = [];
var cursor = db.users.find({'auth.timestamps.loggedin':{$gt: new Date('2017-01-01')}},{'_id':1,'auth':1})
Expand Down

0 comments on commit ba7ff72

Please sign in to comment.