mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
start with metrics mongo script - still need to add "active users"
This commit is contained in:
27
migrations/metrics.js
Normal file
27
migrations/metrics.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var
|
||||
corrupt = {
|
||||
$or: [
|
||||
{lastCron: {$exists:false}},
|
||||
{lastCron: 'new'}
|
||||
]
|
||||
}
|
||||
|
||||
un_registered = {
|
||||
"auth.local": {$exists: false},
|
||||
"auth.facebook": {$exists: false}
|
||||
},
|
||||
|
||||
registered = {
|
||||
$or: [
|
||||
{ 'auth.local': { $exists: true }},
|
||||
{ 'auth.facebook': { $exists: true }}
|
||||
]
|
||||
};
|
||||
|
||||
print('corrupt: ' + db.users.count(corrupt));
|
||||
print('unregistered: ' + db.users.count(un_registered));
|
||||
print('registered: ' + db.users.count(registered));
|
||||
|
||||
// TODO active users
|
||||
// - history > 14 entries
|
||||
// - lastCron < 14d
|
||||
Reference in New Issue
Block a user