mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
finish metrics script. current total: unregistered: 180931 registered:
52101 active: 4182 (@Slappybag)
This commit is contained in:
@@ -1,4 +1,11 @@
|
|||||||
|
// mongo habitrpg ./migrations/metrics.js
|
||||||
|
|
||||||
|
load('./node_modules/moment/moment.js');
|
||||||
|
|
||||||
var
|
var
|
||||||
|
today = +new Date,
|
||||||
|
twoWeeksAgo = +moment().subtract(14, 'days');
|
||||||
|
|
||||||
corrupt = {
|
corrupt = {
|
||||||
$or: [
|
$or: [
|
||||||
{lastCron: {$exists:false}},
|
{lastCron: {$exists:false}},
|
||||||
@@ -16,12 +23,20 @@ var
|
|||||||
{ 'auth.local': { $exists: true }},
|
{ 'auth.local': { $exists: true }},
|
||||||
{ 'auth.facebook': { $exists: true }}
|
{ 'auth.facebook': { $exists: true }}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
active = {
|
||||||
|
$or: [
|
||||||
|
{ 'auth.local': { $exists: true }},
|
||||||
|
{ 'auth.facebook': { $exists: true }}
|
||||||
|
],
|
||||||
|
$where: function(){
|
||||||
|
return this.history && this.history.exp && this.history.exp.length > 14;
|
||||||
|
},
|
||||||
|
'lastCron': {$gt: twoWeeksAgo}
|
||||||
};
|
};
|
||||||
|
|
||||||
print('corrupt: ' + db.users.count(corrupt));
|
print('corrupt: ' + db.users.count(corrupt));
|
||||||
print('unregistered: ' + db.users.count(un_registered));
|
print('unregistered: ' + db.users.count(un_registered));
|
||||||
print('registered: ' + db.users.count(registered));
|
print('registered: ' + db.users.count(registered));
|
||||||
|
print('active: ' + db.users.count(active));
|
||||||
// TODO active users
|
|
||||||
// - history > 14 entries
|
|
||||||
// - lastCron < 14d
|
|
||||||
Reference in New Issue
Block a user