From 4671f4a46bf9aca39f0a09d0bec115a7f8913614 Mon Sep 17 00:00:00 2001 From: neodarz Date: Thu, 8 Aug 2019 13:48:39 +0200 Subject: Implement mongocxx pool connection --- db/mongo_access.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 db/mongo_access.cpp (limited to 'db/mongo_access.cpp') diff --git a/db/mongo_access.cpp b/db/mongo_access.cpp new file mode 100644 index 0000000..56936f3 --- /dev/null +++ b/db/mongo_access.cpp @@ -0,0 +1,16 @@ +#include "mongo_access.h" + +mongo_access::mongo_access(void) {}; +mongo_access::~mongo_access(void) {}; + +void 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 {} + }; + + _pool = bsoncxx::stdx::make_unique(std::move(uri)); + _instance = bsoncxx::stdx::make_unique(bsoncxx::stdx::make_unique()); +} -- cgit v1.2.1