API Docs for:
Show:

MongoDatabase Class

Module: ringo-mongodb

MongoDatabase API.

Constructor

MongoDatabase

(
  • Database
)

Parameters:

  • Database Object

Methods

collectionExists

(
  • collectionName
)
Boolean

Checks to see if a collection exists

Parameters:

  • collectionName String

    The collection to test for existence

Returns:

Boolean: false if no collection by that name exists, true if a match to an existing collection was found

createCollection

(
  • name
  • [options]
)

Creates a collection with a given name and options.

Parameters:

dropDatabase

()

Drops this database

getCollection

(
  • name
)
MongoCollection

Gets a collection with a given name. If the collection does not exist, a new collection is created.

Parameters:

  • name String

    the name of the collection to return

Returns:

MongoCollection: the collection

getCollectionNames

() Array

Returns a set containing the names of all collections in this database

Returns:

Array: the names of collections in this database

Properties

name

String

Database name