Learn R Programming

rmongodb (version 1.8.0)

mongo.add.user: Add a user and password

Description

Add a user and password to the given database on a MongoDB server for authentication purposes.

Usage

mongo.add.user(mongo, username, password, db = "admin")

Arguments

mongo
(mongo) a mongo connection object.
username
(string) username to add.
password
(string) password corresponding to username.
db
(string) The database on the server to which to add the username and password.

Details

See http://www.mongodb.org/display/DOCS/Security+and+Authentication.

See Also

mongo.authenticate, mongo, mongo.create.

Examples

Run this code
mongo <- mongo.create()
if (mongo.is.connected(mongo))
    mongo.add.user(mongo, "Jeff", "H87b5dog")

Run the code above in your browser using DataLab