rmongodb (version 1.8.0)

mongo.drop: Drop a collection from a MongoDB server

Description

Drop a collection from a database on MongoDB server. This removes the entire collection.

Usage

mongo.drop(mongo, ns)

Arguments

mongo
(mongo) A mongo connection object.
ns
(string) The namespace of the collection to drop.

Value

(Logical) TRUE if successful; otherwise, FALSE

Details

Obviously, care should be taken when using this command.

See Also

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

Examples

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

    mongo.destroy(mongo)
}

Run the code above in your browser using DataLab