title: command cursor' object is not subscriptable
body: <p>I'm new in Python and MongoDB and I am starting a new project with flask-python and MongoDB. When I try returning data using the <code>aggregate()</code> function, it gives me the following error:</p>
  
  <blockquote>
    <p>command cursor' object is not subscriptable.</p>
  </blockquote>
  
  <p>Here is my code for the query:</p>
  
  <pre><code>Data = db.mytable.aggregate([ { "$group": {"_id": "$Name" ,"count": { "$sum": 1 }}}])
  return Data['result']
  </code></pre>
  
  <p>I also changed this:</p>
  
  <pre><code>Data = db.mytable.aggregate([ { "$group": {"_id": "$Name" ,"count": { "$sum": 1 }}}],userCursor= False)
  </code></pre>
  
  <p>but it gives me the following error:</p>
  
  <blockquote>
    <p>error.pymongo.errors.OperationFailure: command SON([('aggregate', 'mytable'), ('pipeline', [{'$group': {'_id': '$Name', 'count': {'$sum': 1}}}]), ('useCursor', False)]) on namespace mydb.$cmd failed: unrecognized field 'useCursor</p>
  </blockquote>
  
  <p>Note: I am using MongoDB 3.2 and Python3</p>