title: Find all documents that share max(value) found in aggregate step
body: <p>I'm trying to find all documents that <em>share</em> the max(num_sold).  I cant just sort descending and do a limit(1) because I'd miss the case where other docs also have the same max(num_sold).  Given this over-simplified dataset:</p>
  
  <pre><code>{"item":"Apple", "num_sold": 49}
  {"item":"Orange", "num_sold": 55}
  {"item":"Peach", "num_sold": 55}
  {"item":"Grape", "num_sold": 20}
  {"item":"Banana", "num_sold": 20}
  </code></pre>
  
  <p>I want to get back</p>
  
  <pre><code>{"item":"Orange", "num_sold": 55}
  {"item":"Peach", "num_sold": 55}    
  </code></pre>
  
  <p>Using SQL, this is a simple query and then join back to the main dataset. I'm a bit stumped on how to do this in MongoDB.</p>
  
  <p>I've found the max, but how do I get all docs that have that max?</p>
  
  <pre><code>db.t.aggregate(
      {$group:{
            _id:null,
            num_sold:{$max:"$num_sold"}
            }
      }
  );
  { "_id" : null, "num_sold" : 55 }
  </code></pre>