title: Group by date to get count of hits for a day, for last 7 days and for a months
body: <pre><code>[{'_id': '5ebe39e41e1729d90de',
    'modelId': '5ebe3536c289711579',
    'lastAt': datetime.datetime(2020, 5, 15, 6, 42, 44, 79000),
    'proId': '5ebe3536c2897115793dccfb',
    'genId': '5ebe355ac2897115793dcd04'},
   {'_id': '5ebe3a0d94fcb800fa474310', 
    'modelId': '5ebe3536c289711579',
    'proId': '5ebe3536c2897115793d', 
    'genId': '5ebe355ac2897115793',
    'lastAt': datetime.datetime(2020, 5, 15, 6, 43, 25, 105000)}]
  </code></pre>
  
  <p>I want to calculate count of hits for a day, for last 7 days and for a months. As the model is same, so I want the count of <code>modelId</code> based on <code>lastAt</code>.</p>
  
  <p>I tried aggregate, group functions.</p>