MongoDB client pool. More...
#include <userver/storages/mongo/pool.hpp>
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 () |
void | Ping () |
Friends | |
void | DumpMetric (utils::statistics::Writer &writer, const Pool &pool) |
Writes pool statistics. | |
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().
void storages::mongo::Pool::DropDatabase | ( | ) |
Drops the associated database if it exists. New modifications of collections will attempt to re-create the database automatically.