Azure

Clear Azure CosmosDB Documents

Clear Azure CosmosDB documents using NodeJS

1 minute read

It suprised me that one cannot clear all documents in a CosmosDB collection from the web portal. The only solution for now is to use its SDK, so I wrote a simple Node script. It now can list all the documents and delete them, it can be easily modified to suit your need. var docdb = require("documentdb"); var async = require("async"); var config = { host: "https://xxxx.documents.azure.com:443/", auth: { masterKey: "xxxx" } }; var client = new docdb.