Sort in collection#map_reduce isn't work properly

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Trivial - P5
    • 1.4.0
    • Affects Version/s: 1.3.1
    • Component/s: None
    • Environment:
      Ruby 1.9.2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Kyle Banker (Inactive)
              Reporter:
              Mikhail Dieterle
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: