-
Type: Bug
-
Resolution: Done
-
Priority: Trivial - P5
-
Affects Version/s: 1.3.1
-
Component/s: None
-
Environment:Ruby 1.9.2
From description for #map_reduce method (https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/collection.rb#L581):
@option opts [Array] :sort ([]) an array of [key, direction] pairs to sort by. Direction should
be specified as Mongo::ASCENDING (or :ascending / :asc) or Mongo::DESCENDING (or :descending / :desc)
Actual is needed to do Mongo::Support.format_order_clause for this option.
I.e {:sort => [[:position, :asc]]} raises error, but {:sort => Mongo::Support.format_order_clause([[:position, :asc]])} executes appropriate map/reduce command.