Nearest — Documentation by YARD 0.9.37 (original) (raw)

Class: Mongo::ServerSelector::Nearest

Inherits:

Base

Defined in:

lib/mongo/server_selector/nearest.rb

Overview

Encapsulates specifications for selecting near servers given a list

of candidates.

Constant Summarycollapse

SERVER_FORMATTED_NAME =

Name of the this read preference in the server’s format.

'nearest'.freeze

Instance Attribute Summary

Attributes inherited from Base

#hedge, #max_staleness, #options, #tag_sets

Instance Method Summarycollapse

Methods inherited from Base

#==, #candidates, #initialize, #inspect, #local_threshold, #local_threshold_with_cluster, #select_server, #server_selection_timeout, #suitable_servers, #try_select_server

Instance Method Details

#hedge_allowed? ⇒ true

Whether the hedge option is allowed to be defined for this server preference.

65 66 67 # File 'lib/mongo/server_selector/nearest.rb', line 65 def hedge_allowed? true end

#nameSymbol

Get the name of the server mode type.

40 41 42 # File 'lib/mongo/server_selector/nearest.rb', line 40 def name :nearest end

#secondary_ok? ⇒ true

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Whether the secondaryOk bit should be set on wire protocol messages.

I.e. whether the operation can be performed on a secondary server.
49 50 51 # File 'lib/mongo/server_selector/nearest.rb', line 49 def secondary_ok? true end

#tags_allowed? ⇒ true

Whether tag sets are allowed to be defined for this server preference.

58 59 60 # File 'lib/mongo/server_selector/nearest.rb', line 58 def tags_allowed? true end

#to_doc ⇒ Hash Also known as:to_mongos

Convert this server preference definition into a format appropriate

for sending to a MongoDB server (i.e., as a command field).
75 76 77 # File 'lib/mongo/server_selector/nearest.rb', line 75 def to_doc full_doc end