We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2deda1 commit 9b9b85aCopy full SHA for 9b9b85a
lib/mongo/database.rb
@@ -148,8 +148,8 @@ def collections
148
#
149
# @return [ Hash ] The result of the command execution.
150
def command(operation, opts = {})
151
- preference = opts[:read] ? ServerSelector.get(client.options.merge(opts[:read])) : read_preference
152
- server = preference.select_server(cluster)
+ preference = ServerSelector.get(client.options.merge(opts[:read])) if opts[:read]
+ server = preference ? preference.select_server(cluster) : cluster.next_primary
153
Operation::Command.new({
154
:selector => operation,
155
:db_name => name,
0 commit comments