Creates a new CosmosClient object from a connection string. Your database connection string can be found in the Azure Portal
Creates a new CosmosClient object. See CosmosClientOptions for more details on what options you can use.
bag of options - require at least endpoint and auth to be configured
Used for creating new databases, or querying/reading all databases.
Use .database(id)
to read, replace, or delete a specific, existing database by id.
Used for querying & reading all offers.
Use .offer(id)
to read, or replace existing offers.
Get information about the current DatabaseAccount (including which regions are supported, etc.)
Gets the currently used read endpoint. Useful for troubleshooting purposes.
The url may contain a region suffix (e.g. "-eastus") if we're using location specific endpoints.
Gets the currently used write endpoint url. Useful for troubleshooting purposes.
The url may contain a region suffix (e.g. "-eastus") if we're using location specific endpoints.
Used for reading, or updating a existing offer by id.
The id of the offer.
Generated using TypeDoc
Provides a client-side logical representation of the Azure Cosmos DB database account. This client is used to configure and execute requests in the Azure Cosmos DB database service.
Instantiate a client and create a new database
const client = new CosmosClient({endpoint: "<URL HERE>", auth: {masterKey: "<KEY HERE>"}}); await client.databases.create({id: "<datbase name here>"});
Instantiate a client with custom Connection Policy
const connectionPolicy = new ConnectionPolicy(); connectionPolicy.RequestTimeout = 10000; const client = new CosmosClient({ endpoint: "<URL HERE>", auth: {masterKey: "<KEY HERE>"}, connectionPolicy });