From 63407d96e37df8457e8350e9184b9e3de376fd1f Mon Sep 17 00:00:00 2001 From: Newe Date: Tue, 25 May 2021 12:41:28 +0200 Subject: [edit] Retrieve the event name from mongoDB event payload --- src/mongoStub.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/mongoStub.hpp') 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 #include #include -#include +#include #include +#include -class mongoStub : boost::noncopyable { +class mongoStub{ public: mongoStub(); - std::vector getNewMessages(mongocxx::change_stream* colCs); + + struct mongoMessage{ + std::string eventName; + std::vector data; + }; + + std::vector 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 -- cgit 1.5.1