diff options
Diffstat (limited to 'src/mongoStub.hpp')
-rw-r--r-- | src/mongoStub.hpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mongoStub.hpp b/src/mongoStub.hpp index 3cee472c..71bac792 100644 --- a/src/mongoStub.hpp +++ b/src/mongoStub.hpp @@ -7,23 +7,32 @@ #include <vector> #include <mongocxx/client.hpp> #include <mongocxx/instance.hpp> -#include <mongocxx/v_noabi/mongocxx/change_stream.hpp> +#include <mongocxx/change_stream.hpp> #include <bsoncxx/json.hpp> +#include <bsoncxx/document/element.hpp> -class mongoStub : boost::noncopyable { +class mongoStub{ public: mongoStub(); - std::vector<std::string> getNewMessages(mongocxx::change_stream* colCs); + + struct mongoMessage{ + std::string eventName; + std::vector<std::string> data; + }; + + std::vector<mongoMessage> getNewMessages(mongocxx::change_stream* colCs); mongocxx::collection getCol() const { return col; } + + private: mongocxx::instance instance; mongocxx::client client{mongocxx::uri{}}; mongocxx::database db; mongocxx::collection col; - mongocxx::change_stream* colCs = nullptr; + mongocxx::change_stream* colCs = nullptr; }; #endif |