title: Calculate DAU/MAU from mongodb events
body: <p>Here's what it looks like so far:</p>
  
  <pre><code>  collection.aggregate(
      [
        {
          $match: {
            ct: {$gte: dateFrom, $lt: dateTo },
          }
        },
        {
          $group: { 
            _id: '$user'
          }
        }
      ]
    ).toArray((err, result) =&gt; {
      callback(err, result.length)
    });
  </code></pre>
  
  <p>This gets me a list of users like this which I can count for DAU/MAU:</p>
  
  <p>But I think this is not efficient, what's the correct way of doing this?</p>