#include <userver/storages/mongo/pool.hpp>
MongoDB client pool.
Use constructor only for tests, in production the pool should be retrieved from the components via components::Mongo::GetPool() or components::MultiMongo::GetPool().
Public Member Functions | |
bool | HasCollection (const std::string &name) const |
Checks whether a collection exists. | |
Collection | GetCollection (std::string name) const |
Returns a handle for the specified collection. | |
void | DropDatabase () |
std::vector< std::string > | ListCollectionNames () const |
Get a list of all the collection names in the associated database. | |
void | Ping () |
void | SetPoolSettings (const PoolSettings &pool_settings) |
Sets new dynamic pool settings. | |
void storages::mongo::Pool::DropDatabase | ( | ) |
Drops the associated database if it exists. New modifications of collections will attempt to re-create the database automatically.