rmongodb (version 1.8.0)

mongo.get.database.collections: Get a list of collections in a database

Description

Get a list of collections in a database on a MongoDB server.

Usage

mongo.get.database.collections(mongo, db)

Arguments

mongo
(mongo) A mongo connection object.
db
(string) Name of the database for which to get the list of collections.

Value

(string vector) List of collection namespaces in the given database.Note this will not include the system collection db.system.indexes nor the indexes attached to the database. Use mongo.find(mongo, "db.system.indexes", limit=0L) for information on any indexes.

See Also

mongo.get.databases, mongo.drop.database, mongo.drop, mongo.command, mongo.rename, mongo.

Examples

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

    mongo.destroy(mongo)
}

Run the code above in your browser using DataLab