rmongodb (version 1.8.0)

mongo.get.hosts: Get a lists of hosts & ports as reported by a replica set master upon connection creation.

Description

Get a lists of hosts & ports as reported by a replica set master upon connection creation.

Usage

mongo.get.hosts(mongo)

Arguments

mongo
(mongo) a mongo connection object.

Value

  • NULL if a replica set was not connected to; otherwise, a list of host & port strings in the format "

See Also

mongo.create, mongo

Examples

Run this code
mongo <- mongo.create(c("127.0.0.1", "192.168.0.3"), name="Inventory")
if (mongo.is.connected(mongo))
    print(mongo.get.hosts(mongo))

Run the code above in your browser using DataLab