Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-331

Sort in collection#map_reduce isn't work properly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.4.0
    • Component/s: None
    • Labels:
    • Environment:
      Ruby 1.9.2

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: