-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.0.0
-
Component/s: Public API
-
None
Implementation is probably just in the schedule, but without this read preference for an individual command would be very cumbersome for the user.
Here's a patch that works for me provided that previous fixes are made.
class Database def command(operation, options = {}) server_preference = options[:read] ? ServerPreference.get(options[:read]) : client.server_preference server = server_preference.select_servers(cluster.servers).first raise Mongo::NoReadPreference.new("No replica set member available for query with read preference matching mode #{client.server_preference.name.to_s}") unless server Operation::Command.new({ :selector => operation, :db_name => name, :options => { :limit => -1 } }).execute(server.context) end end