Get document size in Cosmos DB
问题 How can I get or figure out the size of a document stored in Cosmos DB? Is this something already stored within document? 回答1: If you get (or query) a document, you can then look at the headers that come back, specifically x-ms-resource-usage , which will contain a documentsSize attribute (representing a document's size in kb). In node/javascript, you'd make a call that looks something like: client.readDocument(docLink, function (err, doc, headers) { ... }) You'd want to look at headers['x-ms