mongodb/mongo-ruby-driver — pull request #139 by nelhage (2012-12-05 03:47:15+00:00)
Title: Support read preference for a bunch of commands

This branch enables read preference in a consistent manner for a number of commands where it makes sense, notably: `count`, `distinct`, `group`, and `mapreduce`.

The wrappers for those commands, as well as `DB#command` all accept a `:read` flag in their options hashes, which is treated consistently as with `Collection#find`. Calling `DB#command` with a non-`:primary` read preference and a primary-only command is an error.

All named commands will also respect `Collection`- level read preferences.