hal.mongodb package

Submodules

hal.mongodb.models module

Various utilities to deal with MondoDB databases

class hal.mongodb.models.DbBrowser(db_name)[source]

Bases: object

Browse MondoDB database

get_collection(key)[source]

Gets collection with given key

Parameters:key – Name of collection
Returns:Data in collection with given key
get_collection_names()[source]

Gets name of all collections

Returns:List of names of all collections
get_documents_count()[source]

Counts documents in database

Returns:Number of documents in db
get_documents_in_collection(collection_name, with_id=True)[source]

Gets all documents in collection

Parameters:
  • collection_name – Name of collection
  • with_id – True iff each document should also come with its id
Returns:

List of documents in collection in self.db

get_documents_in_database(with_id=True)[source]

Gets all documents in database

Parameters:with_id – True iff each document should also come with its id
Returns:List of documents in collection in database