mongodb/mongo-ruby-driver — pull request #273 by estolfo (2013-09-30 22:59:28+00:00)
Title: Ruby 682 aggregate opts

In order to allow for arbitrary options to be passed to #aggregate, I had to refactor how command options were passed along in Collection.

I changed the #command_options method to not exclude options, just to add a read preference if one was missing.

This allows for #map_reduce, #aggregate, and other commands to be able to just pass along extra options to the command. For example:

@@test.aggregate([], :allowDiskUsage => true)

I also slipped in a small (related) refactor of the #map_reduce method code. Let me know if it's too much in one PR and I'll separate it out.