userver: storages::mongo::MultiMongo Class Reference
Loading...
Searching...
No Matches
storages::mongo::MultiMongo Class Reference

Detailed Description

Definition at line 19 of file multi_mongo.hpp.

Classes

class  PoolSet
 Database set builder. More...
 

Public Member Functions

storages::mongo::PoolPtr GetPool (const std::string &dbalias) const
 Client pool accessor.
 
void AddPool (std::string dbalias)
 Adds a database to the working set by its name. Equivalent to NewPoolSet()-AddExistingPools()-AddPool(dbalias)-Activate()
 
bool RemovePool (const std::string &dbalias)
 Removes the database with the specified name from the working set. Equivalent to NewPoolSet()-AddExistingPools()-RemovePool(dbalias)-Activate()
 
PoolSet NewPoolSet ()
 Creates an empty database set bound to the current MultiMongo instance.
 
const std::string & GetName () const
 

Member Function Documentation

◆ AddPool()

void storages::mongo::MultiMongo::AddPool ( std::string dbalias)

Adds a database to the working set by its name. Equivalent to NewPoolSet()-AddExistingPools()-AddPool(dbalias)-Activate()

Parameters
dbaliasname of the database in secdist config

◆ GetName()

const std::string & storages::mongo::MultiMongo::GetName ( ) const
inline

Definition at line 85 of file multi_mongo.hpp.

◆ GetPool()

storages::mongo::PoolPtr storages::mongo::MultiMongo::GetPool ( const std::string & dbalias) const

Client pool accessor.

Parameters
dbaliasname previously passed to AddPool
Exceptions
PoolNotFoundExceptionif no such database is enabled

◆ RemovePool()

bool storages::mongo::MultiMongo::RemovePool ( const std::string & dbalias)

Removes the database with the specified name from the working set. Equivalent to NewPoolSet()-AddExistingPools()-RemovePool(dbalias)-Activate()

Parameters
dbaliasname of the database passed to AddPool
Returns
whether the database was in the working set

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