azure-cosmosdb-mongoapi

Microsoft Cosmosdb for Mongodb: merge unsharded collection into sharded ones

牧云@^-^@ 提交于 2020-01-25 07:53:06
问题 I have 2 collections of similar documents(i.e. same object, different values). One collection(X) is unsharded in database A, another collection(Y) is sharded and inside database B. When I try copy collection X into database B, I got error saying that "Shared throughput collection should have a partition key". I also tried copying data using foreach insert, but it takes too long time. So my question is, how can I append the data from collection X to collection Y in efficient way? Mongodb

Error CS0006: Metadata file 'MongoDB' could not be found

♀尐吖头ヾ 提交于 2020-01-16 14:10:15
问题 I have created a Azure Function and it has below code in `run.csx' using System; using System.Runtime.Serialization; using System.ServiceModel.Description; using MongoDB.Bson.IO; using MongoDB.Bson; using MongoDB; using MongoDB.Driver; using System.Security.Authentication; using System.Text; using Newtonsoft.Json; public static void Run(string myIoTHubMessage, ILogger log) { log.LogInformation($"C# IoT Hub trigger function processed a message: {myIoTHubMessage}"); } I am having Project.json

Azure CosmosDB operation not supported when using $elemMatch and $in

六眼飞鱼酱① 提交于 2020-01-06 07:12:28
问题 I am doing a query like the following, which works fine with MongoDB, but sometimes fails with CosmosDB. I need it to work with both. ( XXX is a placeholder for any string value. All strings have unique values that are redacted for readability, and actual content should be of no significance.) { server_index: { $elemMatch: { server: "XXX", index: "XXX", delete_time: { $exists: false }, path: { $in: ["XXX", "XXX", "XXX" ] } } } } The schema of a document is somewhat like this: { ..., server

Is it possible to use MongoDB Views with Azure CosmosDB?

[亡魂溺海] 提交于 2019-12-24 19:53:13
问题 I tried to create a view via Robo3T. The command executes successfully, but the view is always empty, no matter how I specify the aggregation pipeline for the view. Example: db.createView("testView","originCollection", [{ $project : { _id: 1 } }]) Does CosmosDB even support views for MongoDB? Edit: As Kevin Smith asked in comments db.testView.stats() returns: { "_t" : "CollStatsResponse", "ok" : 1, "ns" : "myDb.testView", "count" : 0.0, "size" : 0, "avgObjSize" : 0, "numExtents" : 0,

Mongoose with CosmosDB: Getting error `Shared throughput collection should have a partition key`

a 夏天 提交于 2019-12-23 10:06:14
问题 I have a node-express application that currently uses Mongoose to connect to MongoDB, and am attempting to migrate it to Azure Cosmos DB. When I simply allow Mongoose to create the database, the application works fine, however the database is created with individual collection RU pricing. If I create a new database with Shared throughput enabled and attempt to use that, I get the error Shared throughput collection should have a partition key I have tried updating the collection schema to

cosmosdb sql api vs mongodb api which one to use for my scenario.

梦想与她 提交于 2019-12-13 01:18:49
问题 I have a document called "chat" "Chat": [ { "User": {}, "Message": "i have a question", "Time": "06:55 PM" }, { "User": {}, "Message": "will you be able to ", "Time": "06:25 PM" }, { "User": {}, "Message": "ok i will do that", "Time": "07:01 PM" } every time a new chat message arrives i should be able to simple append to this array. mongodb API aggregation pipeline (preview) allows me to use things like $push $addToSet for that if i use sql api i will have to pull the entire document every

Problems inserting document with Mongodb and Logic Apps

扶醉桌前 提交于 2019-12-11 07:57:54
问题 My logic app collects data from an api rest and inserts into a cosmosdb mongodb. The process occurs successfully, but when performing a query using Data Explorer the following error occurs: Error while fetching page of documents: {"code":400,"body":"Command find failed: Unknown server error occurred when processing this request."} Here is an example of a call that reproduces the error: "Create_or_update_document": { "inputs": { "body": { "id": "11111", "name": "john", "surname": "doe" },