aboutsummaryrefslogtreecommitdiff
path: root/db/mongo_access.cpp
blob: a19488ea4261dfe2c281149cd866a014b98f10ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "mongo_access.h"

UmosapiService::mongo_access::mongo_access(void) {};
UmosapiService::mongo_access::~mongo_access(void) {};

void UmosapiService::mongo_access::configure(mongocxx::uri uri) {
    class noop_logger : public mongocxx::logger {
        public:
            virtual void operator()(mongocxx::log_level,
                                    bsoncxx::stdx::string_view,
                                    bsoncxx::stdx::string_view) noexcept {}
    };

    UmosapiService::mongo_access::_pool = bsoncxx::stdx::make_unique<mongocxx::pool>(std::move(uri));
    UmosapiService::mongo_access::_instance = bsoncxx::stdx::make_unique<mongocxx::instance>(bsoncxx::stdx::make_unique<noop_logger>());
}