Support of Azure Cosmos DB for Node.js (< 2.9)

CAST supports Azure Cosmos DB via its com.castsoftware.nodejs extension. Details about how this support is provided for Node.js source code is discussed below.


Icon Description

Node.js Azure CosmosDB Client

Node.js Azure CosmosDB Database

Node.js Azure CosmosDB Collection

Node.js Azure CosmosDB Unknown Client

Node.js Azure CosmosDB Unknown Database

Node.js CosmosDB Unknown Collection

What results can you expect?

Some example scenarios are shown below:

Cosmos DB client creation

const CosmosClient = require("@azure/cosmos");
const endpoint = ''

const client = new CosmosClient({ endpoint: endpoint, auth: { masterKey } });

Database and collection creation


const databaseId = 'My database'
const collectionId = 'My collection'

const dbResponse = client.databases.createIfNotExists({
  id: databaseId
database = dbResponse.database;

const coResponse = database.containers.createIfNotExists({
  id: collectionId
container = coResponse.container;

These declarations create a useSelectLink from the source code to the collection

var param = {
    query: "SELECT * FROM root r WHERE r.completed=@completed",
    parameters: [
            name: '@completed',
            value: false

const { result: results } = container.items

This declaration create a useDeleteLink from the source code to the database