4 var period = 86400000 * 30;
6 var p1 = new Date(now - period);
8 var a = db.chatmessages.aggregate([{
10 _id: { $gt: createIdForTimestampString(p1) },
11 sent: { $type: 'date' }
17 activeUsers: { $addToSet: '$fromUserId' }
30 'troupe.oneToOne': { $ne: true }
35 activeUsers: { $size: '$activeUsers' }
40 totalChats: { $sum: '$chats' },
49 numActivUsers: '$_id',
54 printCSV(a, ['numActivUsers', 'totalChats']);