Azure Cosmos DB for NoSQL Connector
With this connector, Hasura allows you to instantly create a real-time GraphQL API on top of your data models in Azure Cosmos DB for NoSQL Database containers. This connector supports Azure Cosmos DB for NoSQL's functionalities listed in the table below, allowing for efficient and scalable data operations.
This connector is built using the TypeScript Data Connector SDK and implements the Data Connector Spec.
Features
Below, you'll find a matrix of all supported features for the Azure Cosmos DB for NoSQL connector:
Feature | Supported | Notes |
---|---|---|
Native Queries + Logical Models | ✅ | |
Simple Object Query | ✅ | |
Filter / Search | ✅ | |
Simple Aggregation | ✅ | |
Sort | ✅ | |
Paginate | ✅ | |
Nested Objects | ✅ | |
Nested Arrays | ✅ | |
Nested Filtering | ✅ | |
Nested Sorting | ❌ | |
Nested Relationships | ❌ |
Prerequisites
- Create a Hasura Cloud account
- Please ensure you have the DDN CLI and Docker installed
- Create a supergraph
- Create a subgraph
The steps below explain how to initialize and configure a connector on your local machine (typically for development purposes).You can learn how to deploy a connector to Hasura DDN — after it's been configured — here.
Using the Azure Cosmos DB for NoSQL connector
With the context set for an existing subgraph, initialize
the connector by choosing hasura/azure-cosmos
. When the wizard runs, you'll also be prompted to enter the following
env vars necessary for your connector to function:
Name | Description | Required |
---|---|---|
AZURE_COSMOS_KEY | The Azure Cosmos DB for NoSQL DB key | Yes |
AZURE_COSMOS_DB_NAME | Name of the Azure Cosmos DB for NoSQL DB | Yes |
AZURE_COSMOS_ENDPOINT | Endpoint of the Azure Cosmos DB for NoSQL DB | Yes |
AZURE_COSMOS_MANAGED_CLIENT_ID | Managed client ID of the Azure Cosmos DB for NoSQL | Yes |
AZURE_COSMOS_NO_OF_ROWS_TO_FETCH | Maximum number of rows to fetch per container to infer the schema of the container. | No |
Note: AZURE_COSMOS_CONNECTOR_NO_OF_ROWS_TO_FETCH
is an optional field, with 100 rows to be fetched by default.
After the CLI initializes the connector, you'll need to:
- Introspect the source.
- Add your models, commands, and relationships.
- Create a new build.
- Test it by running your project along with the connector.
Contributing
We're happy to receive any contributions from the community. Please refer to our development guide.
License
The Hasura Azure Cosmos DB for NoSQL connector is available under the Apache License 2.0.