CatapultServer  v0.5.0.1 (Elephant)
catapult::mongo::MongoDatabase Class Reference

Represents a mongo database. More...

Public Member Functions

 MongoDatabase (mongocxx::pool &connectionPool, const std::string &databaseName)
 Creates a mongo database around connectionPool and databaseName. More...
 
 operator const mongocxx::database & () const
 Gets a const reference to the underlying mongocxx database. More...
 
 operator mongocxx::database & ()
 Gets a reference to the underlying mongocxx database. More...
 
const mongocxx::collection operator[] (const std::string &collectionName) const
 Gets the const mongocxx collection with name collectionName. More...
 
mongocxx::collection operator[] (const std::string &collectionName)
 Gets the mongocxx collection with name collectionName. More...
 

Private Attributes

mongocxx::pool::entry m_pConnection
 
mongocxx::database m_database
 

Detailed Description

Represents a mongo database.

Constructor & Destructor Documentation

◆ MongoDatabase()

catapult::mongo::MongoDatabase::MongoDatabase ( mongocxx::pool &  connectionPool,
const std::string &  databaseName 
)
inlineexplicit

Creates a mongo database around connectionPool and databaseName.

Member Function Documentation

◆ operator const mongocxx::database &()

catapult::mongo::MongoDatabase::operator const mongocxx::database & ( ) const
inline

Gets a const reference to the underlying mongocxx database.

◆ operator mongocxx::database &()

catapult::mongo::MongoDatabase::operator mongocxx::database & ( )
inline

Gets a reference to the underlying mongocxx database.

◆ operator[]() [1/2]

mongocxx::collection catapult::mongo::MongoDatabase::operator[] ( const std::string &  collectionName)
inline

Gets the mongocxx collection with name collectionName.

◆ operator[]() [2/2]

const mongocxx::collection catapult::mongo::MongoDatabase::operator[] ( const std::string &  collectionName) const
inline

Gets the const mongocxx collection with name collectionName.

Member Data Documentation

◆ m_database

mongocxx::database catapult::mongo::MongoDatabase::m_database
private

◆ m_pConnection

mongocxx::pool::entry catapult::mongo::MongoDatabase::m_pConnection
private

The documentation for this class was generated from the following file: