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

Fatal error while migrating Cosmos DB Emulator (MongoDB API) to Azure

I'm having a lot of issues migrating a localhost Cosmos DB database hosted in the Cosmos DB Emulator to an online Cosmos DB instance on Azure. I have used Microsoft's data migration tool to upload the current database, converted to JSON files, to a…
2
votes
1 answer

Update Existing Documents in Cosmos db using Azure Data Factory

I have created a data factory to Update my existing Cosmos DB using data stored in Blob as csv file. The csv file contains two fields column "X" and "Y" and their values. I want to insert new key in my existing Cosmos Db as Y ,filter criteria is…
2
votes
1 answer

Cosmos DB maximum file size limit 1.5MB

I'm trying to update a json file in an azure cosmos database using pymongo's update_one/update_many methods. I'm get an error code 17419 (Resulting document after update is larger than x) According to the azure cosmos db documentation, the file size…
2
votes
1 answer

Correct syntax for top x rows MongoDB Strict in Azure Data Factory pipeline

I'm using a pipeline to copy data from CosmoDB to a Azure Data Lake, this within a Data Factory. I'm using the MongoDB API instead of the SQL. There is a field in which we can enter a Filter expression, in the manuals there is specified that we have…
2
votes
1 answer

CosmosDb Mongo database request issue

I have a .Net application who interact with a mongoDb database on CosmosDb. I have a find request who looks like this : public async Task GetCurrentZonierVersionNumberAsync(string productCode, string risqueType) { if…
Xavier W.
  • 1,270
  • 3
  • 21
  • 47
2
votes
1 answer

Mongo Go Driver Count() method gets "Invalid response from server, value field is not a number" from Azure CosmosDB MongoDB Api Count()

I'm using Azure Cosmos DB with MongoDB Api with my project, developed with Golang and MongoDB Go Drivers. When I try to get a count using below code gives the error Invalid response from server, value field is not a number itemCount, err :=…
Serdar Kalaycı
  • 391
  • 1
  • 4
  • 10
2
votes
2 answers

Partition Key Vs Document Id in CosmosDB

If I store documents without providing partition key, In this case documentId will be treated as Partition Key of Logical Partition? If yes: how about Billion logical partitions in that collection? I have query to only look by documentId. Now inside…
2
votes
1 answer

MongoDB timeout Exception (C#)

We're developing a chatbot using microsoft framework (v3) along with cosmos's mongo API. We've had no issues up until recently when the bot suddenly stopped working locally. On further inspection, we found that we were getting a timeout exception.…
2
votes
0 answers

Azure cosmosdb mongo api error ion asp.net core

I am getting the below error when I try to connect to Azure cosmosdb mongo api from my asp.net core : Error: TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector Code used: readonly string _cn =…
2
votes
2 answers

How to create a collection in a shared throughput cosmosdb using the Mongo API

I have an Azure CosmosDb database with database-level throughput provisioned. We're using the MongoDB API against this Cosmos instance. The shared throughput model requires all collections to have a partition key specified, which seems to prevent…
Dusty
  • 3,946
  • 2
  • 27
  • 41
2
votes
2 answers

Azure CosmosDB: Can One Set RBAC per Database/Collection

Given an Azure CosmosDB DB instance that is created from the Azure portal, it is possible to create multiple databases from a shell connection with the following commands: use someNewDbName; db.someNewCollectionName.insert({}); With other DB…
Jacob Horbulyk
  • 2,366
  • 5
  • 22
  • 34
2
votes
1 answer

CosmosDB Mongo API: select specific fields

I'm using Azure CosmosDB Data explorer (Azure Portal -> Azure Cosmos DB -> Data Explorer). There're only JSON query string {"foo": "bar"}. How can I select only specific field or use aggregate command there? e.g., document structure: { "age": 30, …
lagrange-
  • 215
  • 1
  • 2
  • 9
2
votes
2 answers

Azure Cosmos MongoDB - Create collection with shard key

I need to create a collection in Azure's Cosmos MongoDB but with a partition/shard key as the required configuration is that the database will have a provisioned throughput (a set amount of RU's) and the collections in it will have a shared…
Tomer Something
  • 770
  • 1
  • 10
  • 24
2
votes
0 answers

Unable to connect to Azure Cosmos Db using mongo db api

I am trying to connect to azure cosmos db using mongo db api (spark mongo db connector )to export data to hdfs but I get the below exception: Below is the complete stacktrace: { "_t" : "OKMongoResponse", "ok" : 0, "code" : 115, "errmsg" : "Command…
2
votes
0 answers

Cosmos DB pagination leading to "Request rate is large" exceptions

I have implemented a class to read from Cosmos DB using the MongoDB.Driver.IMongoClient. I need pagination as there are a large number of items in each collection, I thought I had achieved this with the following: private async…
RagtimeWilly
  • 5,265
  • 3
  • 25
  • 41