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-cosmosdb
7,586
questions
-2
votes
1
answer
48
views
How is Azure Cosmos DB for NoSQL a document database (non relational) and supports SQL at the same time?
According to Azure documentation Cosmos DB is a document database (non relational) and at the same time it supoprts SQL, how is that possible ?
<<The Azure Cosmos DB API for NoSQL stores data in ...
0
votes
0
answers
62
views
Facing issue to create Cosmos Db using .NET core SDK
The code successfully created the container, which is now available for use. However, when attempting to create a database, it enters an infinite loop.
var name = "cosmosdb_emulator";
var ...
0
votes
1
answer
26
views
.net Azure Cosmos SDK: Predicatebuilder for Query in nested collection
I have a data structure
public record CarMake
{
public List<Car> Cars { get; set; }
public string Id {get;set; }
}
now I want to use a Predicate-Builder to only return those items from ...
0
votes
0
answers
43
views
Cosmos Gremlin API unique property value policy
I have several vertex types (labels), and for each of them i would like a unique property that would stop any additional vertex to be created with the same property. Think phone number for the phone ...
0
votes
0
answers
35
views
LINQ expression could not be translated querying child list properties
Doing something that seems really simple using EF, DbContext and CosmosDB. Trying to get a list of items based on a field in a child list being equal to a parameter.
Source of the predicate to the ...
0
votes
1
answer
35
views
Cosmos Db pre or post triggers not being triggered
I have a cosmos db for NoSql instance I'm working on.
I have a collection, let's coll it "my-coll".
I want to add a property in any document being added to the collection.
The Training for ...
0
votes
0
answers
16
views
Cosmos DB number precision issue when aggregating [duplicate]
I ran into an issue with a query that was summing up multiple values and returning the sum back to the calling .net application and so have been trying to figure out the right way to go about this. On ...
0
votes
1
answer
64
views
The type or namespace name 'Id' could not be found (are you missing a using directive or an assembly reference?) CosmosDBOutput Problem
So the problem that I am encoutring is that I can't use "ID" again, it keeps giving me error for my CosmosDBOutput, I'm not sure why that is but I need help with this if anyone can help fix ...
0
votes
0
answers
35
views
500 Internal Server Error when Posting to Azure Serverless Function Connecting to Cosmos DB with Node.js [closed]
I am new to Azure serverless functions and I am attempting to create an Azure Function that connects to Cosmos DB (NoSQL). So far, I have set up my Cosmos DB and created an Azure Function. I have also ...
-3
votes
0
answers
35
views
How to update postgres server parameters like effective_cache_size on Azure Cosmos Db for citus extension? [closed]
I didn't get the parameter to update the value like effective_cache_size and maintenance_work_mem etc.
I have checked both coordinator and worker nodes but didn't get effective_cache_size, ...
0
votes
1
answer
27
views
How to connect in case Azure Cosmos DB default force use TLS/SSL?
My case:
Client: Windows 10 x64. pgAdmin 4 version 8.4 (latest).
Server: Cloud Azure Cosmos DB for PostgreSQL burstable, version 16.
My connection string will be likes this
jdbc:postgresql://c-...
-2
votes
0
answers
31
views
Customer Managed Key for Azure cosmosdb for postgresql using Terraform [closed]
Does anyone has an idea on how to add customer managed key to Azure cosmosdb for Postgresql through Terraform.
I went through this document(https://registry.terraform.io/providers/hashicorp/azurerm/...
0
votes
1
answer
48
views
.net Azure Cosmos SDK aggregate functions
No matter what I try, I cannot get Max(), MaxAsync() or a direct SQL Query get to work in Microsoft.Azure.Cosmos 3.38.1.
If I run the following statement in the Cosmos DB Emulator
SELECT MAX(f....
0
votes
0
answers
27
views
CosmosDB EF Core 8 derived type configuration
I'd like to use a common base class for a collection in cosmosdb and query it via EF Core 8. The general idea is that my entities will be similar and have a common base but be able to add new ...
0
votes
1
answer
88
views
How to add new documents to Azure AI Search Index with potential new fields
I'd like to have an azure function such that whenever there is a new document added to an Azure Cosmos DB service, it automatically adds this new document to an existing index of an Azure AI Search ...
0
votes
0
answers
16
views
SpringData - CosmosDB - FluxUsingWhen cannot be cast to class Slice - Pagination
I am trying implement Pagination in cosmosdb as per the link here as follows.
@Repository
public interface UserRepository extends ReactiveCosmosRepository<User, String>{
Slice<User> ...
0
votes
1
answer
25
views
Partition rebalancing on data deletion in Cosmos DB
We have a query regarding the partition rebalancing mechanism in Cosmos DB, particularly when a significant amount of data is deleted from the database.
In our use case scenario, we are interested in ...
0
votes
0
answers
49
views
CosmoDB SQL - Select sub document properties
I have a CosmoDB document that looks like this:
{
"id": "something",
"object": {
"a": {
"property": "xxx"
...
0
votes
0
answers
38
views
Query result inconsistency between stored procedure and SDK calls [closed]
I have a clean up stored procedure that deletes data in Cosmos DB. Before deleting the items, it queries based on a small condition which you can see in the code snippet.
var filterQuery =
{
...
1
vote
1
answer
28
views
Azure NoSQL cosmosdb schema validation/locking
We are creating .Net core 7 based CRUD operation apis. database is Azure NoSQL cosmos db. We are using CosmosClient.
Our apis are stable now.
We want to ensure that any new changes in api's do not ...
0
votes
0
answers
30
views
Cosmos DB Indexing policy [closed]
The below is my cosmos db document object
{
"id": "0ef78d0e-0a8d-448d-b50b-8203c7b086fc",
"ConsumerID": "123512",
"ConsumerName": "...
1
vote
1
answer
83
views
Azure Cosmos DB for MongoDB (vCore) connection string not valid exception
I've set up a free cosmos DB for mongoDB vcore database without any issues, I've then been able to utilise the provided connection string to connect to the database with my credentials on both ...
0
votes
0
answers
58
views
C#, EF Core CosmosDB - could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation
Using this very simple (IMHO) line of code I and getting below error. I am using EF and CosmosDB. I have tried calling 'ToList' and others per the error, but no luck. Perhaps something simple that ...
2
votes
0
answers
58
views
CosmosDB: .NET/C# Mongo API: Simple upsert on single document causes MongoExecutionTimeoutException: Operation exceeded time limit
We are having intermittent, but daily, issues across all our services that use the Azure CosmosDB MongoDB. Even though the write pressure is not high, seemingly random upsert operations suddenly stop ...
0
votes
0
answers
106
views
Can not connected to ComosDB for MongoDB (vCore) from Azure Data Factory
i try to add Cosmos DB Linked service in Azure Data Factory to copy documents from NoSQL API database to MongoDB API (vCore) database.
In ADF we have default connectors to Cosmos DB NoSQL API but not ...
0
votes
1
answer
46
views
Updating value of the document / row in azure cosmosdb in python
Evening all,
I am writing small project, and want to add to te website hosted in azure storage (which is static) visit counter.
I want to write short script in python that when called in Azure ...
0
votes
1
answer
50
views
How to query against array in Cosmos using sql?
This is my data where I want to get stockNumber if operationId in lineItems is occurring more than once.
i.e., as an output, my query should return 2002762240 out of these 2 records because it has ...
0
votes
0
answers
47
views
Create a non partition container in Azure cosmos db using python script
I'm using this script to create a non partition container, i.e. without specifying any partition key while running the python script. I want to insert some records to this container without specifying ...
0
votes
1
answer
154
views
Cosmos DB not triggering
I need some help clarifying something here. I'm have two functions as seen below
Function.cs
[Function("TestServiceBus")]
public async Task ServiceBusReceivedMessageFunction(
[...
0
votes
1
answer
37
views
Need help flattening a multi-array item in Cosmos
I'm still somewhat inexperienced with Cosmos. I have a multi-array item that I need to flatten. What we have are multiple Project items with a variable number of Resources. Each Resource also has a ...
0
votes
0
answers
80
views
Unable to Retrieve Documents After Applying Query on Azure REST API via postman
I am encountering an issue while performing a Cosmos query in Postman. Despite executing the same query successfully on Azure, Postman isn't retrieving any documents, as depicted in the attached ...
0
votes
1
answer
53
views
How to query DateTimeOffset in Cosmos?
I have the following data where I want to query against itemUpdateDateTime.
[
{
"itemUpdateDateTime": "2024-08-13T22:34:35.9988856+00:00",
"location": ...
-1
votes
1
answer
86
views
How to deploy to Azure Static Web App with database connection in Svelte using GitHub workflow?
I have created a Svelte skeleton web application and a Cosmos NoSQL database. I installed the swa CLI tool using npm install -g @azure/static-web-apps-cli command. Furthermore, I was following the ...
0
votes
0
answers
58
views
Is there a specified order for data replication among different partitions in Cosmos DB?
I have 1 write region (e.g., US), and 2 read regions (e.g., US and EU). I have a collection, and I want to write into it, using different partition keys. I wonder, is there a specified order for data ...
0
votes
1
answer
150
views
connection is insufficiently secured Error in Azure cosmos DB Data Migration tool
I am trying to load JSON file data into cosmos DB container using Azure cosmos DB data migration tool but I'm unable verify my database connection when clicked on verify. The error is as follows
I ...
1
vote
0
answers
71
views
Azure Cosmos MongoDB says Out of Throughput of one account, but is working on a different account [closed]
When I implemented my codes on my local end and my private account, Azure cosmos DB works for me. But when I try to connect to a different account, I got this warning:
Error in /nonogram route: ...
1
vote
1
answer
64
views
Cannot reduce RU on Azure Cosmos DB
I need help to know why I can't adjust these down to 400 RU/s from 1000 RU/s:
Azure Cosmos DB Screenshot
When I set to Manual I also get this issue:
Manual Provisioning
What steps do I need to take to ...
0
votes
1
answer
82
views
Execute background process in python
In python, I am trying to run a process (storing huge amount of data to db) as a background process and it should not wait to return the response of current executing function. I tried the below code. ...
0
votes
1
answer
57
views
Why do I get different @CosmosDBInput properties then every documentation I can find?
I want to connect to a Cosmos DB in Azure from Azure Functions written in Java Code in an Maven Project (written in Intellij). The whole thing should be triggered by a HTTP request. The HTTP request ...
0
votes
1
answer
92
views
How to log a QueryDefinition with applied parameters?
One can create a QueryDefinition (package: Microsoft.Azure.Cosmos) in .NET with following C# code
QueryDefinition query = new QueryDefinition(
"select * from t where t.Account = @account"...
2
votes
1
answer
55
views
Possible mutation of static readonly record through Cosmos SDK and Newtonsoft
This is a very awkward error and it took me a while to tackle it down to these few lines of code. The full code can be grabbed as fiddle, but you have to provide your Cosmos Url and Key to let it run. ...
0
votes
1
answer
106
views
Cosmos query to find unique count
I have the following documents in Cosmos where I want to get distinct count of stockNumber with associated lineItems with Waiting-Reconciliation status.
Data:
Doc-1:
{
"stockNumber": &...
0
votes
1
answer
61
views
Azure Data Factory converts date strings to unix timestamp
I have an ADF that I want to use to copy documents between to CosmosDB containers. In the process, I wish to a a new column 'type' with a hardcoded value. It works great.
There is however 2 fields on ...
0
votes
1
answer
92
views
How to convert string "mm/dd/yyyy hh:mm:ss AM/PM" to DateTime format in Cosmos DB query
How to convert string "mm/dd/yyyy hh:mm:ss AM/PM" to DateTime format in Cosmos DB query.
E.g.: Date is stored as "8/19/2023 4:44:55 PM" and it needs to converted into standard date ...
1
vote
0
answers
60
views
Partition a non partitioned container in azure cosmos db without any downtime [closed]
I have a non partitioned container in azure cosmos DB, which has a size of 5.9 GB. I want to make this container partitioned using one of its fields. Since this container is being used in the live ...
1
vote
1
answer
97
views
Current Code Cosmos DB 3.37.1: PartitionKey key mismatch exception
This question had been asked many times and even answered correctly a few times, I've seen them all, and yet, it happens to me no matter what I do. Here is the code:
Creating container:
string ...
1
vote
1
answer
74
views
How to enable the server side entry feature for Cosmos db using Bicep template
I have not defined anything related to the features in my script and not sure what to be included to enable the "ServerSideEntry" feature for a cosmos db.
Below one is my script:
// Cosmos ...
2
votes
1
answer
85
views
Get a result object from Cosmos DB that has an interface as an object member
Currently I have a class stored in Cosmos DB. That class has an interface as a member variable. When I try and query for that and iterate over the results I get an exception.
public class Group
{
[...
0
votes
0
answers
94
views
Find count greater than 1 in Azure CosmosDB
I am querying the below to get the count, uniqueid, Amount
Select uniqueID,c.AmtPercent, count(1) as count from c Group by c.uniqueId, c.AmtPercent
I want the rows where count(1) > 1
Please see the ...
0
votes
0
answers
93
views
Azure cosmos db emulator macOS - Win32Exception/CoreCLR
I have downloaded the docker image azure-cosmos-emulator:latest on macOS(BigSur). It starts up fine but when I try to load it in the browser(https://localhost:8081/_explorer/index.html), I'm getting 2 ...