title: allowDiskUse not working in pymongo
body: <p>I have data stored in MongoDB in the following format.</p>
  
  <pre><code>{
      "_id" : ObjectId("570b487fb5360dd1e5ef840c"),
      "internal_id" : 1,
      "created_at" : ISODate("2015-07-14T10:08:38.994Z"),
      "updated_at" : ISODate("2016-01-10T00:35:19.748Z"),
      "ad_account_id" : 1,
      "updated_time" : "2013-08-05T04:48:49-0700",
      "created_time" : "2013-08-05T04:46:35-0700",
      "name" : "Sale1",
      "daily": [
                   {"clicks": 5000, "date": "2015-04-16"},
                   {"clicks": 5100, "date": "2015-04-17"},
                   {"clicks": 5030, "date": "2015-04-20"}
               ]
      "custom_tags" : {
          "Event" : {
              "name" : "Clicks"
          },
          "Objective" : {
              "name" : "Sale"
          },
          "Image" : {
              "name" : "43c3fe7b262cde5f476ed303e472c65a"
          },
          "Goal" : {
              "name" : "10"
          },
          "Type" : {
               "name" : "None"
          },
          "Call To Action" : {
               "name" : "None",
          },
          "Landing Pages" : {
              "name" : "www.google.com",
      }
  }
  </code></pre>
  
  <p>I am trying to group individual documents by <code>internal_id</code> to find the aggregate sum of clicks from say <code>2015-04-15</code> to <code>2015-04-21</code> using the <code>aggregate</code> method.</p>
  
  <p>In pymongo, when I try to do an <code>aggregate</code> using just <code>$project</code> on <code>internal_id</code>, I get the results, but when I try to <code>$project</code> <code>custom_tags</code> fields, I get the following error:</p>
  
  <pre><code>OperationFailure: Exceeded memory limit for $group, but didn't allow external sort.
  Pass allowDiskUse:true to opt in.
  </code></pre>
  
  <p>Following the answer <a href="https://stackoverflow.com/questions/26069601/how-to-aggregate-on-huge-array-in-mongodb">here</a>, I even changed my aggregate function to <code>list(collection._get_collection().aggregate(mongo_query["pipeline"], allowDiskUse=True))</code>. But this still keeps throwing the earlier error.</p>