-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added MongoDB C++ Driver Ported to 64-bit due to ease to use mongocxx Removed nlohmann/json A MongoDBInstance Singleton Class is created Config File is added for mongoDB URI(not in public repo) Leadershipboard now shows Top Ten Players having highest Scores Email Validation is implemented using Regex
- Loading branch information
Showing
22 changed files
with
454 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <string> | ||
#include <iostream> | ||
#include "../Header Files/Config.h" | ||
|
||
#include "bsoncxx/builder/stream/document.hpp" | ||
#include "bsoncxx/json.hpp" | ||
#include "bsoncxx/oid.hpp" | ||
#include "mongocxx/client.hpp" | ||
#include "mongocxx/database.hpp" | ||
#include "mongocxx/uri.hpp" | ||
#include <mongocxx/exception/operation_exception.hpp> | ||
|
||
namespace learning { | ||
const mongocxx::uri mongoURI(mongodb_uri); | ||
const std::string dbName = databaseName; | ||
const std::string collName = colectionName; | ||
class MongoDB { | ||
public: | ||
MongoDB(); | ||
void insertDocument(const bsoncxx::document::value document); | ||
std::tuple<std::string, std::string, std::string> findDocument(const std::string& value); | ||
bool isDataPresent(const std::string& key, const std::string& value); | ||
int findScore(const std::string& value); | ||
void updateDocument(const std::string& key, const int& value, const std::string& newKey, const int& newValue); | ||
std::vector<std::pair<std::string, int>> getTopScores(int limit); | ||
private: | ||
mongocxx::options::client client_options; | ||
mongocxx::options::server_api api; | ||
mongocxx::client conn; | ||
mongocxx::v_noabi::database ammpedUPDB; | ||
mongocxx::v_noabi::collection loginInfoCollection; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
#include <mongocxx/instance.hpp> | ||
|
||
class MongoInstance { | ||
private: | ||
static mongocxx::instance instance; // Private static member variable | ||
|
||
public: | ||
static mongocxx::instance& getInstance() { | ||
return instance; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.