Database#command method lacks options for read preference and tags

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.0.0
    • Affects Version/s: 2.0.0
    • Component/s: Public API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
            Reporter:
            Gary Murakami (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: