Learn R Programming

rmongodb (version 1.8.0)

mongo.get.primary: Get the host & port of the server to which a mongo object is connected.

Description

Get the host & port of the server to which a mongo object is connected.

Usage

mongo.get.primary(mongo)

Arguments

mongo
(mongo) a mongo connection object.

Value

String host & port in the format "%s:%d".

See Also

mongo.create, mongo.

Examples

Run this code
## Not run: 
# mongo <- mongo.create(c("127.0.0.1", "192.168.0.3"))
# if (mongo.is.connected(mongo)) {
#     print(mongo.get.primary(mongo))
# }
# ## End(Not run)

Run the code above in your browser using DataLab