Method: Mongo::Server::Description#primary_host

Defined in:
lib/mongo/server/description.rb

#primary_hostString | nil

Get the address of the primary host.

Examples:

Get the address of the primary.

description.primary_host

Returns:

  • (String | nil)

    The address of the primary.

Since:

  • 2.6.0



624
625
626
# File 'lib/mongo/server/description.rb', line 624

def primary_host
  config[PRIMARY_HOST] && config[PRIMARY_HOST].downcase
end