|
Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
|
An asynchronous MongoDB client using coroutines. More...
#include <MongoClient.hpp>

Classes | |
| struct | Config |
| Configuration options for the MongoDB client. More... | |
| struct | InsertAwaiter |
| struct | QueryAwaiter |
| struct | QueryResult |
Public Member Functions | |
| MongoClient (concurrency::ThreadPool &thread_pool, const Config &config) | |
| Constructs a new MongoClient. | |
| ~MongoClient () | |
| MongoClient (const MongoClient &)=delete | |
| MongoClient & | operator= (const MongoClient &)=delete |
| QueryAwaiter | find_async (std::string query_json) |
| Executes a find query asynchronously. | |
| InsertAwaiter | insert_async (std::string doc_json) |
| Inserts a document asynchronously. | |
| concurrency::ThreadPool & | get_thread_pool () |
| Gets the associated thread pool. | |
| mongoc_client_pool_t * | get_pool () |
| Gets the underlying MongoDB client pool. | |
| const Config & | get_config () const |
| Gets the configuration used by this client. | |
Private Attributes | |
| concurrency::ThreadPool & | thread_pool_ |
| Config | config_ |
| mongoc_uri_t * | uri_ {nullptr} |
| mongoc_client_pool_t * | pool_ {nullptr} |
An asynchronous MongoDB client using coroutines.
| orbit::database::MongoClient::MongoClient | ( | concurrency::ThreadPool & | thread_pool, |
| const Config & | config | ||
| ) |
Constructs a new MongoClient.
| thread_pool | The thread pool to use for asynchronous operations. |
| config | The configuration settings for the MongoDB client. |
| orbit::database::MongoClient::~MongoClient | ( | ) |
|
delete |
| QueryAwaiter orbit::database::MongoClient::find_async | ( | std::string | query_json | ) |
Executes a find query asynchronously.
| query_json | The JSON string representing the query. |
|
inline |
Gets the configuration used by this client.
|
inline |
Gets the underlying MongoDB client pool.
|
inline |
Gets the associated thread pool.
| InsertAwaiter orbit::database::MongoClient::insert_async | ( | std::string | doc_json | ) |
Inserts a document asynchronously.
| doc_json | The JSON string representing the document to insert. |
|
delete |
|
private |
|
private |
|
private |
|
private |