summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-25 23:38:06 +0200
committerGitHub <noreply@github.com>2021-05-25 23:38:06 +0200
commitd2fb1ee4588436eca9bb0097bd06ca05dbc3e5f0 (patch)
tree28421cf19cd53b2e75fe64d844215145967d1ee3 /src/main.cpp
parentMerge pull request #20 from ItsNewe/master (diff)
parent[del] Deleted .proto (diff)
downloadserver-d2fb1ee4588436eca9bb0097bd06ca05dbc3e5f0.tar.xz
Merge pull request #21 from ItsNewe/master
Mongo payload data retrieval
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