Module mongorover.MongoDatabase

Database level operations.

Class mongorover.MongoDatabase

mongorover.MongoDatabase:new (client, database_name) Creates a new MongoDatabase instance.
mongorover.MongoDatabase:getCollection (collection_name) Creates MongoCollection instance.
mongorover.MongoDatabase:getCollectionNames () Returns array of collection names.
mongorover.MongoDatabase:drop_database () Drops the database.
mongorover.MongoDatabase:hasCollection (collectionName) Returns boolean whether the collection is present in the database.
mongorover.MongoDatabase:command (command[, value], options) Issue a command to MongoDB by and get response back.


Class mongorover.MongoDatabase

Database level operations.
mongorover.MongoDatabase:new (client, database_name)
Creates a new MongoDatabase instance. Called by MongoClient's getDatabase(...) method.

Parameters:

  • client MongoClient A MongoClient instance.
  • database_name string

Returns:

    A MongoDatabase instance.

See also:

mongorover.MongoDatabase:getCollection (collection_name)
Creates MongoCollection instance.

Parameters:

  • collection_name string Name of collection.

Returns:

    A MongoCollection instance.
mongorover.MongoDatabase:getCollectionNames ()
Returns array of collection names.

Returns:

    {string,...} An array containing the names of collections in the database.
mongorover.MongoDatabase:drop_database ()
Drops the database.
mongorover.MongoDatabase:hasCollection (collectionName)
Returns boolean whether the collection is present in the database.

Parameters:

  • collectionName string The name of the database.

Returns:

    boolean A boolean value whether the database has the collection.
mongorover.MongoDatabase:command (command[, value], options)
Issue a command to MongoDB by and get response back.

Parameters:

  • command string
  • value Value for command. Defaults to 1. (optional)
  • options table Additional options for database command.

Returns:

    table Response from server.
generated by LDoc 1.4.3 Last updated 2015-09-16 03:55:02