Package emma :: Module database :: Class DB
[hide private]
[frames] | no frames]

Class DB

source code

Database class

It is a singleton class, so any instantion of it will get the global database.

Instance Methods [hide private]
 
__init__(self) source code
 
connect(self, host, port, name)
Connect to a mongoDB database
source code
 
collection(self, coll)
Get a database collection
source code
 
core(self)
Get the core collection
source code
Class Variables [hide private]
  __ = {}
Method Details [hide private]

connect(self, host, port, name)

source code 

Connect to a mongoDB database

That method must be call before any use of the database

Parameters:
  • name (string) - database name

collection(self, coll)

source code 

Get a database collection

Parameters:
  • coll (string) - coll name
Returns:
mongoDb collection

core(self)

source code 

Get the core collection

The collection use by the core of emma

Returns:
mongoDb collection