Learn R Programming

rmongodb (version 1.8.0)

mongo.reconnect: Reconnect to a MongoDB server

Description

Reconnect to a MongoDB server. Calls mongo.disconnect and then attempts to re-establish the connection.

Usage

mongo.reconnect(mongo)

Arguments

mongo
(mongo) a mongo connection object.

See Also

mongo.create, mongo.disconnect, mongo.

Examples

Run this code
mongo <- mongo.create()
if (mongo.is.connected(mongo))
    mongo.reconnect(mongo)

Run the code above in your browser using DataLab