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
2
votes
1 answer

connecting from node to Azure CosmosDB Mongodb database

I am trying to connect to Azure CosmosDB - MongoDb from a node application. and the following code: I am using a connection-string that has the following: var url =…
Ghassan Karwchan
  • 3,355
  • 7
  • 37
  • 65
2
votes
1 answer

Deleting document from CosmosDb using c# SDK

I am trying to delete a document from CosmosDB using the code below but each time Keep getting the following error: "Microsoft.Azure.Documents.DocumentClientException: Entity with the specified id does not exist in the system" The document is…
d199224
  • 531
  • 2
  • 8
  • 23
2
votes
0 answers

Mongoose Client keep pinging CosmosDB with IsMaster 12 times per minute

Made a simple NodeJS app that uses Mongoose client to connect to CosmosDB (via MongoDB API). After a while I noticed that my CosmosDB instance is receiving many IsMaster requests from my application (+12 times per minute). Image bellow: Azure…
2
votes
1 answer

c# Cosmos Db check if file exists before creating

I have this method: public async Task SaveAsync(IEnumerable models) { foreach (var document in models) { var collectionLink = UriFactory.CreateDocumentCollectionUri(_databaseName, _collectionName); await…
r3plica
  • 13,017
  • 23
  • 128
  • 290
2
votes
1 answer

Change two bytes in a GUID

I'm using a partitioned CosmosDb, but I don't know the value of the partition key each time I want to get a resource by its id. Now using the id as partition key is not a solution for me, since it would take too long and take up too much space (I…
Carmen
  • 55
  • 3
2
votes
1 answer

How do I use SQL Parameter for CONTAINS query in Azure Cosmos DB SQL API?

I have the following sql variable: SELECT * FROM x WHERE x.Description CONTAINS(@p1) I have configured a SQL Parameter with name @p1 and a valid string i.e. "foo" and added it to the SqlParameterCollection collection variable with the…
David Lee
  • 73
  • 6
2
votes
2 answers

CosmosDb Partition Key For Nested Java Object/Json (Spring Boot)

I'm trying to partition a collection based on a nested Java object and the corresponding Json. I know it might seem unreasonable to do this, but I am working on a project far into development, and the layout expected by our client team is not…
2
votes
2 answers

How to measure Azure CosmosDB Request Units per web request?

In an ASP.NET Core Web Application I want to measure how many request units have been spent in a single web request. With this information I could identify "expensive" calls and look for optimizing them. I know how to option the request unit count…
Ralf Bönning
  • 14,515
  • 5
  • 49
  • 67
2
votes
1 answer

CosmosDb: Call a stored procedure from another stored procedure or trigger

In Azure Cosmos Db, is there a way to call a stored procedure from another stored procedure? What about UDF? Can I call a UDF from another UDF, Stored procedure, or Trigger?
Saeid
  • 1,573
  • 3
  • 19
  • 37
2
votes
1 answer

Get Documents from Cosmosdb Java Cross partition query is required but disabled

public static Document getDocumentById(String id) { FeedOptions queryOptions = new FeedOptions(); queryOptions.setMaxItemCount(10); queryOptions.setEnableCrossPartitionQuery(true); // Retrieve the document using the DocumentClient. …
mshah49rs
  • 35
  • 4
2
votes
2 answers

Azure Cosmos query to convert into List

This is my JSON data, which is stored into cosmos db { "id": "e064a694-8e1e-4660-a3ef-6b894e9414f7", "Name": "Name", "keyData": { "Keys": [ "Government", "Training", "support" ] …
Jayendran
  • 9,638
  • 8
  • 60
  • 103
2
votes
1 answer

Cosmos: DISTINCT results with JOIN and ORDER BY

I'm trying to write a query that uses a JOIN to perform a geo-spatial match against locations in a array. I got it working, but added DISTINCT in order to de-duplicate (Query A): SELECT DISTINCT VALUE u FROM u JOIN loc IN u.locations WHERE …
me--
  • 1,978
  • 1
  • 22
  • 42
2
votes
2 answers

Azure Cosmos UDF to return default value if key doesnt exist

I have a document structure in Cosmos that typically looks like this: { "Item No": "123456", "Item Desc": "This is a description", "images": [ "https://somedomain.com/image1.png", "https://somedomain.com/image2.png" …
Crayons
  • 1,906
  • 1
  • 14
  • 35
2
votes
1 answer

Azure Function App CosmosDbTrigger Gives Null Parameter Error

I am defining an Azure Function App as follows: public static void Run( [CosmosDBTrigger( databaseName: "dbName", collectionName: "collectiontoMonitor", ConnectionStringSetting =…
Shamim Hafiz - MSFT
  • 21,454
  • 43
  • 116
  • 176
2
votes
1 answer

Azure CosmosDB SQL Record counts

I have a CosmosDB Collection which I'm querying using the REST API. I'd like to access the total number of documents which match my query. I know I can do a count, but that means two calls, one for the count and a subsequent one to retrieve the…
andym
  • 41
  • 2