CosmosClient Class Reference¶
Defined in siddiqsoft/cosmoscl.hpp inside namespace siddiqsoft.
Member Functions¶
Configuration & Connection¶
configure¶
Configures the client with connection strings and partition key names.
primaryEndpoint¶
Returns the configured CosmosEndpoint.
Document Operations¶
createDocument¶
Creates a new document in the specified database and container.
readDocument¶
Reads a document by id and partitionKey.
replaceDocument¶
Replaces an existing document.
deleteDocument¶
Deletes a document by id and partitionKey.
Query Operations¶
queryDocuments¶
Executes a SQL query against the container.
queryDocumentsIterable¶
Returns an iterable response structure for navigating multi-page query results.
Database Operations¶
createDatabase / getDatabase / listDatabases / deleteDatabase¶
CosmosResponseType createDatabase(const CosmosArgumentType& arg);
CosmosResponseType getDatabase(const CosmosArgumentType& arg);
CosmosResponseType listDatabases(const CosmosArgumentType& arg);
CosmosResponseType deleteDatabase(const CosmosArgumentType& arg);
Container Operations¶
createContainer / getContainer / listContainers / deleteContainer¶
CosmosResponseType createContainer(const CosmosArgumentType& arg);
CosmosResponseType getContainer(const CosmosArgumentType& arg);
CosmosResponseType listContainers(const CosmosArgumentType& arg);
CosmosResponseType deleteContainer(const CosmosArgumentType& arg);
Asynchronous Execution¶
sendAsync¶
void sendAsync(
CosmosOperation op,
CosmosArgumentType arg,
std::function<void(CosmosResponseType)> callback
);
callback upon completion.