az_cosmosdb: Azure Cosmos DB account class

Description Methods Details Endpoints See Also

Description

Class representing an Azure Cosmos DB account. For working with the data inside the account, see cosmos_endpoint and cosmos_database.

Methods

The following methods are available, in addition to those provided by the AzureRMR::az_resource class:

Details

Initializing a new object of this class can either retrieve an existing Cosmos DB resource, or create a new resource on the host. Generally, the best way to initialize an object is via the get_cosmosdb_account or create_cosmosdb_account methods of the AzureRMR::az_resource_group class, which handle the details automatically.

Endpoints

Azure Cosmos DB provides multiple APIs for accessing the data stored within the account. You choose at account creation the API that you want to use: core (SQL), table storage, Mongo DB, Apache Cassandra, or Gremlin. The following methods allow you to create an endpoint object corresponding to these APIs.

Note that AzureCosmosR provides a client framework only for the SQL API. To use the table storage API, you will also need the AzureTableStor package, and to use the MongoDB API, you will need the mongolite package. Currently, the Cassandra and Gremlin APIs are not supported.

As an alternative to AzureCosmosR, you can also use the ODBC protocol to interface with the SQL API. By installing a suitable ODBC driver, you can then talk to Cosmos DB in a manner similar to other SQL databases. An advantage of the ODBC interface is that it fully supports cross-partition queries, unlike the REST API. A disadvantage is that it does not support nested document fields; functions like array_contains() cannot be used, and attempts to reference arrays and objects may return incorrect results.

See Also

get_cosmosdb_account, create_cosmosdb_account, delete_cosmosdb_account

cosmos_endpoint, cosmos_database, cosmos_container, query_documents, cosmos_mongo_endpoint, AzureTableStor::table_endpoint, mongolite::mongo


AzureCosmosR documentation built on Jan. 19, 2021, 1:07 a.m.