Learn R Programming

rmongodb (version 1.8.0)

mongo.drop.database: Drop a database from a MongoDB server

Description

Drop a database from MongoDB server. Removes the entire database and all collections in it.

Usage

mongo.drop.database(mongo, db)

Arguments

mongo
(mongo) A mongo connection object.
db
(string) The name of the database to drop.

Value

(Logical) TRUE if successful; otherwise, FALSE

Details

Obviously, care should be taken when using this command.

See Also

mongo.drop, mongo.command, mongo.rename, mongo.count, mongo.

Examples

Run this code
mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
    print(mongo.drop.database(mongo, "test"))

    mongo.destroy(mongo)
}

Run the code above in your browser using DataLab