summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorNewe <speedy.wolfy@outlook.com>2021-05-25 12:41:28 +0200
committerNewe <speedy.wolfy@outlook.com>2021-05-25 12:41:28 +0200
commit63407d96e37df8457e8350e9184b9e3de376fd1f (patch)
treeddc85cc13bcc72a33f1d6716c1c4c16c2b5195bd /src/main.cpp
parent[edit] Edited README (diff)
downloadserver-63407d96e37df8457e8350e9184b9e3de376fd1f.tar.xz
[edit] Retrieve the event name from mongoDB event payload
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp

index bd4ebbec..372eaa00 100644 --- a/src/main.cpp +++ b/src/main.cpp
@@ -30,16 +30,18 @@ int main(int argc, char **argv){ auto mongoHandler = std::make_unique<mongoStub>(); mongocxx::options::change_stream options; + //voiceEvents collection watcher mongocxx::change_stream colCs = mongoHandler->getCol().watch(options); + std::cout << "Server created and listening for events" << std::endl; + //Check for new messages in the collection for (;;){ - std::vector<std::string> t = mongoHandler->getNewMessages(&colCs); + std::vector<mongoStub::mongoMessage> t = mongoHandler->getNewMessages(&colCs); for(auto &i : t){ - std::cout << i << std::endl; + std::cout << "[" << i.eventName << "] " << std::endl; } } - std::cout << "Server created" << std::endl; return 0; } \ No newline at end of file