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

Database#command method lacks options for read preference and tags

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0
    • 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
      

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            gjmurakami Gary Murakami
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: