-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.4.3
-
Component/s: Public API
-
None
-
Environment:MRI 2.3
The rdoc for Collection#find has
@option opts [:primary, :secondary] :read The default read preference for queries # initiates from this connection object. If +:secondary+ is chosen, reads will be sent # to one of the closest available secondary nodes. If a secondary node cannot be located, the # read will be sent to the primary. If this option is left unspecified, the value of the read # preference for this Collection object will be used.
However the code seems to expect that a server selector is passed, as snippets like
database['some_collection'].find({},{read: {mode: :secondary}}).first
raises the following error
NoMethodError: undefined method `select_server' for {"mode"=>:secondary}:BSON::Document