Questions tagged [azure-cosmosdb]

Azure Cosmos DB is Microsoft's fully managed and serverless distributed database with support for NoSQL and relational workloads. It offers global distribution across all Azure regions transparently replicating your data wherever your users are. Develop applications using open-source database engines, including PostgreSQL, MongoDB, and Cassandra. Get automatic scalability, enterprise-grade security, and cost-effective consumption-based pricing.

Azure Cosmos DB is a fully managed, distributed NoSQL and relational database for modern app development. Get single-digit millisecond response times and up to 99.999-percent availability, backed by SLAs. Build cloud-native apps quickly and easily using your preferred tools with support for open-source PostgreSQL, MongoDB and Apache Cassandra. Enjoy automatic and instant scalability, and fast writes and reads anywhere in the world with turnkey data replication and multi-region writes. Gain insight over real-time data with no-ETL analytics using Azure Synapse Link for Azure Cosmos DB.

7404 questions
14
votes
4 answers

Get CosmosDb Primary Connection String in ARM template

I have an ARM template which sources the primaryMasterKey of a cosmosDb as follows: { "properties": { "enabled": true, "siteConfig": { "appSettings": [ { "name":…
ubienewbie
  • 1,771
  • 17
  • 31
14
votes
2 answers

How can I pass array as a sql query param for cosmos DB query

I want to pass array as a param to SqlQuerySpec to be able to use it in the IN expression when building query for azure cosmos db. What i'm trying to do is something like we do with regular (string, int etc) params: private SqlQuerySpec…
Olha Shumeliuk
  • 720
  • 7
  • 14
14
votes
3 answers

The type or namespace name 'Azure' does not exist in the namespace 'Microsoft'

I am working on a Windows 10 UWP app and would like to store some information in Cosmos DB. Following the getting started instructions does not work with Microsoft Azure DocumentDB NuGet package 1.19.1, nor with former ones. The type or namespace…
AnotherNewbie
  • 198
  • 1
  • 1
  • 6
14
votes
1 answer

Get all the Partition Keys in Azure Cosmos DB collection

I have recently started using Azure Cosmos DB in our project. For the reporting purpose, we need to get all the Partition Keys in the collection. I could not find any suitable API to achieve it.
user2364893
  • 171
  • 1
  • 2
  • 4
14
votes
2 answers

azure cosmosdb very expensive

Can someone explain how I can configure Azure cosmosDB to not be so expensive? 30€ for 3 days?? It's a small test environment with very few users. In the backend, I only see that it will cost some cents ... Here is my Cost overview: I have around…
aumanjoa
  • 905
  • 1
  • 11
  • 30
14
votes
2 answers

Azure: DocumentDB Mongo $group is not supported

After migrating my Mongo app to DocumentDB on Azure the $group queries are no longer working and are throwing the following error: { MongoError: '$group' is not supported', name: 'MongoError', message: '\'$group\' is not supported', _t:…
Anshuul Kai
  • 3,876
  • 2
  • 27
  • 48
14
votes
2 answers

How to Upload multiple Document (bulk) in Document DB

I have Documents list(object) that object has multiple documents i.e. Json records are present but while I try to upload that Bunches of Document(Records) it not upload on document DB but while I upload Single Document records it upload…
Pravin Sharma
  • 1,160
  • 1
  • 8
  • 20
13
votes
2 answers

Cosmos DB Patch child object

I'm trying to patch a child object of a Cosmos Db document using the new Partial Document Update feature. However, I can't find a way to do it. If the document looks like below, how would you update child (in the Items array) with ID 2 ProductCode…
Pietv
  • 215
  • 2
  • 8
13
votes
2 answers

How to use HAVING in CosmosDB

I am trying to use the following query to see if I have duplicates in the DB SELECT c.VariantNo, count(1) AS jongel FROM c where c.brand = 'XXXX' AND c.Consumer = 'XXX_V2' GROUP BY c.VariantNo HAVING jongel > 1 But I am getting a syntax error close…
Matt Douhan
  • 2,053
  • 1
  • 21
  • 40
13
votes
3 answers

Using the sort() cursor method without the default indexing policy in Azure Cosmos DB for MongoDB API

With Cosmos DB for MongoDB API (Version 3.4), the following find query in combination with the method cursor sort seems to behave incorrectly: db.test.find({"field1": "value1"}).sort({"field2": 1}) The error occurs, if all of the following…
Mathias
  • 211
  • 3
  • 10
13
votes
4 answers

How can I backup an Azure Cosmos DB

I have an Azure Cosmos DB and I need to delete all the resources from this subscription. Is there any way to take a backup offline from the portal?
Georgia Kalyva
  • 737
  • 2
  • 9
  • 23
13
votes
3 answers

Azure SQL API vs Azure Mongo API

I'm very new in the world of "NoSQL", Recently I started using Cosmos DB for JSON documents and am able to store and get data using CosmosDB "SQL" and "Mongo" API. Which API is best for me? (requirement: Performance, Low Latency, Huge Collection,…
Pankaj Rawat
  • 4,037
  • 6
  • 41
  • 73
13
votes
1 answer

Cosmos DB Mongo API How to manage "Request Rate is Large" condition

I Have the following code.. async function bulkInsert(db, collectionName, documents) { try { const cosmosResults = await db.collection(collectionName).insertMany(documents); console.log(cosmosResults); return cosmosResults } catch…
mark d drake
  • 1,280
  • 12
  • 20
13
votes
3 answers

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?
Sam
  • 26,817
  • 58
  • 206
  • 383
13
votes
4 answers

CosmosDB - DocumentDB - Bulk insert without saturating collection RU

I am investigating using Azure CosmosDB for an application that would require high read throughput, and the ability to scale. 99% of the activity would be reads, but occasionally we would need to insert somewhere from just a few documents to…
QTom
  • 1,441
  • 1
  • 13
  • 29