Questions tagged [azure-cosmosdb-mongoapi]

Azure Cosmos DB databases can be configured to use the MongoDB API. Via this feature Cosmos DB aims to provide a compatible server interface for applications using the MongoDB wire protocol. Since Cosmos DB is a distinct implementation from MongoDB server, some server commands may not be supported yet or may differ in behavior.

Documentation

437 questions
2
votes
4 answers

How to maximize DB upload rate with azure cosmos db

Here is my problem. I am trying to upload a large csv file to cosmos db (~14gb) but I am finding it difficult to maximize the throughput I am paying for. On the azure portal metrics overview UI, it says that I am using 73 RU/s when I am paying for…
2
votes
1 answer

AF Binding to CosmosDb

I'm trying to output data from an Azure function to CosmosDb (MongoDb), I have the following binding setup: [DocumentDB("mydatabase", "mycollection", ConnectionStringSetting = "CosmosDBConnection", CreateIfNotExists= true, PartitionKey…
smolesen
  • 1,153
  • 3
  • 11
  • 29
2
votes
3 answers

How To Enable Azure Cosmos DB Preview Features (aggregation pipeline and Mongodbv3.4) via Powershell?

I would like to enable Aggregation Pipeline and MongoDBv3.4 preview features programmatically through AzureRM Powershell. So far I've tried to do that through Azure ARM Template and Set-AzureRmResource command without any success.…
2
votes
1 answer

Not able to connect to cosmos document db from code and from RoboMongo IDE

I am trying to connect to cosmos db, but getting below timeout error. System.TimeoutException: 'A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors =…
praveen
  • 41
  • 7
2
votes
0 answers

Azure CosmosDB MongoAPI - Cursor during skip/take is dead after 300 results?

After porting some of our Nodejs running processes to use Azure's CosmosDB MongoAPI instead of MLab's DB hosting I have had nothing but problems. The real show-stopper I encountered was a dead cursor when I try to page through a fairly large…
Eat at Joes
  • 4,937
  • 1
  • 40
  • 40
2
votes
1 answer

ERROR Caused by: com.mongodb.MongoCommandException: Command failed with error 61: query in command must target a single shard key on server

Getting this error "query in command must target a single shard key' on server " while doing collection.count(queryParams);. In Java, how can I read all the data from all the shard/multiple shards? We are using Microsoft Azure Cosmos DB. [ERROR]…
Dib
  • 59
  • 1
  • 5
1
vote
1 answer

SSL handshake failed in cosmosdb mongo api with python

I am trying to connect a database in azure cosmos that uses the Mongo DB API in Python. When I create the client, I get the SSL handshake failed error and I don't know how to solve it. I am aware that there is some thread that talks about this…
1
vote
1 answer

MongoDB aggregation get values of multiple documents for last timestamp

This is a follow up question on my original post here: Improve MongoDB query in Python My collection of hiking trails looks like this: Each trail might be available multiple times for the same date based on comments set by users. { "_id": .., …
1
vote
1 answer

Azure Cosmos DB - Maximum number of 'Collection' per account exceeded. Current configured quota 100

I'm trying to create on Azure Cosmos DB with MongoDB driver, a new collection. I've reached the limit of 100 collection for account cause it's a serverless account. Now I've deleted some old databases and collection a couple of days ago to free up…
pigiax
  • 13
  • 3
1
vote
1 answer

How to find and replace string inside arrays in MongoDB and pymongo

I have a collection in MongoDB.(Technically it is the cosmosDB API for MongoDB but in theory that shouldn’t matter.) The collection contains nested arrays of strings. These strings contain brackets inside them, and I need to remove them from the…
compx
  • 15
  • 7
1
vote
1 answer

How to filter by DBRef in CosmosDB for MongoDB?

I am using Azure Cosmos DB for MongoDB. I have two collections: cars and parkings. A car knows what parking it is in via an @DBRef . I have the following document classes @Document("cars") data class CarDocument( @Id val id: String, @DBRef …
1
vote
1 answer

Azure Cosmos DB Change Feed with MongoDB API (Not change stream!)

I've been struggling to understand the Azure Cosmos DB official docs. This link shows that change feed can work with the "MongoDB" : Change feed in Azure Cosmos DB But the following paragraph is what is confusing me: So my question is following…
1
vote
1 answer

Taking backup of cosmos DB using mongodumo is failing

I am using mongodump command to take backup of an Azure Cosmos DB. It runs for some time and is then failing with Failed: error writing data for collection test.testcollection to disk: error reading collection:[-3]) incomplete read of full message:…
1
vote
1 answer

Does CosmosDB MongoDB API support expireAfterSeconds of -1 for "Infinity" TTL?

I have a collection where different types of documents have different useful life spans. The main document for an entity should never be automatically deleted but it can have ancillary associated documents which are viable to age out by policy after…
Martin Smith
  • 438,706
  • 87
  • 741
  • 845
1
vote
0 answers

Azure Cosmos with Next JS - MongoServerSelectionError: Command hello not supported prior to authentication ERROR

While connecting Azure Cosmos for MongoDB from Next JS - mongodb (version: 5.0.1) I am getting this error - [next-auth][error][adapter_error_getSessionAndUser] https://next-auth.js.org/errors#adapter_error_getsessionanduser Command hello not…