title: mongodb in-memory sort with projection or limit
body: <p>I'm running a query against MongoDB (3.2 in my case) with a sort, and I'm getting:</p>
  
  <pre><code>OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM.
  </code></pre>
  
  <p>I understand that I can use an index to avoid this. In my case this is an operation that I run very rarely, so the overhead of an index doesn't make sense (it's also fine if this operation takes a long time and consumes a lot of resources). I'm pretty sure I'll end up using an aggregation with <code>allowDiskUse</code> to work around this, but I was curious about something.</p>
  
  <p>I'm curious whether using a projection can reduce the memory footprint required by the in-memory sort. Similarly I'm wondering whether a <code>limit()</code> can reduce this footprint (since the sort only needs to keep the top/bottom N in memory).</p>