armarx::armem::server::ltm::util::mongodb Namespace Reference

Namespaces

 detail
 

Functions

std::optional< mongocxx::collection > collectionExists (mongocxx::database &db, const std::string &collectionName)
 
std::optional< mongocxx::database > databaseExists (mongocxx::client &client, const std::string &databaseName)
 
std::optional< nlohmann::json > documentExists (mongocxx::collection &collection, const nlohmann::json &json)
 
mongocxx::collection ensureCollectionExists (mongocxx::database &db, const std::string &collectionName, bool createIfNotExistent)
 
mongocxx::database ensureDatabaseExists (mongocxx::client &client, const std::string &databaseName, bool createIfNotExistent)
 
nlohmann::json ensureDocumentExists (mongocxx::collection &collection, const nlohmann::json &json, bool createIfNotExistent)
 
std::vector< nlohmann::json > getAllDocuments (mongocxx::collection &collection)
 
nlohmann::json readDataFromDocument (mongocxx::collection &collection, const nlohmann::json &json)
 
std::string toCollectionName (const armem::MemoryID &id)
 
std::string toDocumentID (const armem::MemoryID &id)
 
void writeDataToDocument (mongocxx::collection &collection, const nlohmann::json &query, const nlohmann::json &update)
 

Function Documentation

◆ collectionExists()

std::optional< mongocxx::collection > collectionExists ( mongocxx::database &  db,
const std::string &  collectionName 
)

Definition at line 111 of file mongodb.cpp.

+ Here is the caller graph for this function:

◆ databaseExists()

std::optional< mongocxx::database > databaseExists ( mongocxx::client &  client,
const std::string &  databaseName 
)

Definition at line 83 of file mongodb.cpp.

+ Here is the caller graph for this function:

◆ documentExists()

std::optional< nlohmann::json > documentExists ( mongocxx::collection &  collection,
const nlohmann::json &  json 
)

Definition at line 175 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensureCollectionExists()

mongocxx::collection ensureCollectionExists ( mongocxx::database &  db,
const std::string &  collectionName,
bool  createIfNotExistent 
)

Definition at line 121 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensureDatabaseExists()

mongocxx::database ensureDatabaseExists ( mongocxx::client &  client,
const std::string &  databaseName,
bool  createIfNotExistent 
)

Definition at line 94 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensureDocumentExists()

nlohmann::json ensureDocumentExists ( mongocxx::collection &  collection,
const nlohmann::json &  json,
bool  createIfNotExistent 
)

Definition at line 181 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllDocuments()

std::vector< nlohmann::json > getAllDocuments ( mongocxx::collection &  collection)

Definition at line 239 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDataFromDocument()

nlohmann::json readDataFromDocument ( mongocxx::collection &  collection,
const nlohmann::json &  json 
)

Definition at line 210 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toCollectionName()

std::string toCollectionName ( const armem::MemoryID id)

Definition at line 150 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toDocumentID()

std::string toDocumentID ( const armem::MemoryID id)

Definition at line 138 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeDataToDocument()

void writeDataToDocument ( mongocxx::collection &  collection,
const nlohmann::json &  query,
const nlohmann::json &  update 
)

Definition at line 221 of file mongodb.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: