title: Does MongoDB's Map/Reduce sort work?
body: <p>If the following is used</p>
  
  <pre><code>Analytic.collection.map_reduce(map, reduce, 
    :query =&gt; {:page =&gt; subclass_name}, 
    :sort =&gt; [[:pageviews, Mongo::DESCENDING]]).find.to_a
  </code></pre>
  
  <p>it won't sort by <code>pageviews</code>.  Alternatively, if it is array of hash:</p>
  
  <pre><code>Analytic.collection.map_reduce(map, reduce, 
    :query =&gt; {:page =&gt; subclass_name}, 
    :sort =&gt; [{:pageviews =&gt; Mongo::DESCENDING}]).find.to_a
  </code></pre>
  
  <p>it won't work either.  I think the reason it has to be an array is to specify the first field to sort by, etc.  I also tried just a flat array instead of an array of array like in the first code listing up above and it didn't work either.</p>
  
  <p>Is it not working?  This is the spec: <a href="http://api.mongodb.org/ruby/current/Mongo/Collection.html#map_reduce-instance_method" rel="nofollow noreferrer">http://api.mongodb.org/ruby/current/Mongo/Collection.html#map_reduce-instance_method</a></p>