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

map_reduce :out parameter does not accept :db

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.0
    • Affects Version/s: 1.5.2
    • Component/s: None
    • None

      When running a mapreduce that looks like this:
      coll.mapreduce(map('uuid'), reduce, {:out => { :replace => scratch, 'db' => 'dp'},
      :query => {:uuid => r}.merge(ts)})

      I get this:
      /Users/nacuff/.rvm/gems/ruby-1.9.2-p180/gems/mongo-1.5.1/lib/mongo/collection.rb:64:in `initialize': new_name must be a string or symbol (TypeError)
      from /Users/nacuff/.rvm/gems/ruby-1.9.2-p180/gems/mongo-1.5.1/lib/mongo/db.rb:314:in `new'
      from /Users/nacuff/.rvm/gems/ruby-1.9.2-p180/gems/mongo-1.5.1/lib/mongo/db.rb:314:in `collection'
      from /Users/nacuff/.rvm/gems/ruby-1.9.2-p180/gems/mongo-1.5.1/lib/mongo/collection.rb:627:in `map_reduce'

      removing the 'db' (or :db) key makes it work just fine.

            Assignee:
            tyler@10gen.com Tyler Brock
            Reporter:
            nacuff@igodigital.com Nathan Acuff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: