title: Mongo aggregation doesn't work in pymongo
body: <p>I am trying to make a query with aggregate in Django, it works fine with my local computer but not in the server.</p>
  
  <p>In both machines, pymongo is installed in Python virtual enviroment:</p>
  
  <pre><code>pip freeze | grep mongo
  pymongo==2.5.2
  </code></pre>
  
  <p>I can also get the inserted data in two machines with find() method:
          conn.firmalar.searchlogger.find()</p>
  
  <p>But aggregate method works in my local but not in the server even everything installed are the same. I got this error when i attempt to run it on server:</p>
  
  <pre><code>import pymongo
  conn = pymongo.Connection()
  search = conn.firmalar.searchlogger.aggregate([{"$group": {"_id": "$what", "count": {"$sum": 1}}}])
  
      OperationFailure at /admin/weblog/
  command SON([('aggregate', u'searchlogger'), ('pipeline', [{'$group': {'count': {'$sum': 1}, '_id': '$what'}}])]) failed: no such cmd: aggregate
  
      /home/cem/env/firmalar/local/lib/python2.7/site-packages/pymongo/collection.pyc in aggregate(self, pipeline)
     1059                                          self.secondary_acceptable_latency_ms),
     1060                                         slave_okay=self.slave_okay,
  -&gt; 1061                                         _use_master=use_master)
     1062 
     1063     # TODO key and condition ought to be optional, but deprecation
  
  
  /home/cem/env/firmalar/local/lib/python2.7/site-packages/pymongo/helpers.pyc in _check_command_response(response, reset, msg, allowable_errors)
      145             if code in (11000, 11001, 12582):
      146                 raise DuplicateKeyError(errmsg, code)
  --&gt; 147             raise OperationFailure(msg % errmsg, code)
      148 
      149 
  </code></pre>