azure-cosmosdb

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

Writing to Cosmos DB Graph API from Databricks (Apache Spark)

本秂侑毒 提交于 2019-12-13 00:56:30
问题 I have a DataFrame in Databricks which I want to use to create a graph in Cosmos, with one row in the DataFrame equating to 1 vertex in Cosmos. When I write to Cosmos I can't see any properties on the vertices, just a generated id. Get data: data = spark.sql("select * from graph.testgraph") Configuration: writeConfig = { "Endpoint" : "******", "Masterkey" : "******", "Database" : "graph", "Collection" : "TestGraph", "Upsert" : "true", "query_pagesize" : "100000", "bulkimport": "true",

Azure Functions and DocumentDB triggers

安稳与你 提交于 2019-12-12 18:17:56
问题 Is it possible to specify the DocumentDB is to fire triggers when writing to DocumentDB? I have an Azure function that pulls JSON messages off a Service Bus Queue and puts them into DocumentDB like so: using System; using System.Threading.Tasks; public static string Run(string myQueueItem, TraceWriter log) { log.Info($"C# ServiceBus queue trigger function processed message: {myQueueItem}"); return myQueueItem; } This inserts new documents into the database as they are added to the service bus

CosmosDB, very long index that's also the partition key

我与影子孤独终老i 提交于 2019-12-12 16:59:29
问题 We are storing a folder tree, the number of items is huge so we have created a partition on the parent folder. When we issue queries such as SELECT * FROM root WHERE root.parentPath = "\\server\share\shortpath" AND root.isFile The RUs is very low and the performance is very good. But, when we have a long path eg SELECT * FROM root WHERE root.parentPath = "\\server\share\a very\long\path\longer\than\this" AND root.isFile The RUs go up to 5000 and the performance suffers. parentPath works well

Order By not working in Azure Web Document Explorer

筅森魡賤 提交于 2019-12-12 16:52:48
问题 I am trying to query documentdb inside the Azure Web Document Explorer. The problem is Order By doesn't seem to work anymore. For instance the following query: SELECT * FROM c WHERE c.type="myType" ORDER BY c.createdDate When queried I get a red alert stating: Failed to get documents. Please try again. If I remove Order By it works fine. Any idea why it doesn't work anymore to query with Order By? 回答1: Any idea why it doesn't work anymore to query with Order By? Order By can be specified only

Is it possible to disable the 5 second time limit for Azure CosmosDB stored procedures

一世执手 提交于 2019-12-12 16:40:56
问题 I have recently been doing some work using a stored procedure in Azure's CosmosDB to update some documents. The Documents are a bit chunky (5000+ lines documents and dealing with about a 1000 of them) and the sproc takes more than 5 seconds to run. The 5 second limit stops the sproc from running, throwing the time limit exceeded error. So, I am asking if this can be turned off or configured? I have read this question about some possible work arounds, which I am looking at along with some

Request rate is large

强颜欢笑 提交于 2019-12-12 14:39:02
问题 Im using Azure documentdb and accessing it through my node.js on express server, when I query in loop, low volume of few hundred there is no issue. But when query in loop slightly large volume, say around thousand plus I get partial results (inconsistent, every time I run result values are not same. May be because of asynchronous nature of Node.js) after few results it crashes with this error body: '{"code":"429","message":"Message: {\"Errors\":[\"Request rate is large\"]}\r\nActivityId:

Cosmos DB succeeds and fails on randomly on the same query, saying they are cross partition when they aren't

試著忘記壹切 提交于 2019-12-12 14:27:27
问题 I have a collection with the partition key "flightConversationId". I am doing a very simple query, BY THE PARTITON KEY FIELD SELECT * from root WHERE root.flightConversationId="b36d13c0-cbec-11e7-a4ad-8fcedf370f98" When doing this query via the nodeJS SDK, it will work one second, and fail the next with the error: Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid

Would using a substring of a GUID in CosmosDB as partitionkey be a bad idea?

强颜欢笑 提交于 2019-12-12 14:25:50
问题 I'm doing some R&D to move a product catalog into CosmosDB. In it's simplest terms a Product document will have: Product Id (GUID) Product Name Manufacturer A manufacturer will log into this system and will only be able to query their own data so there will always be a ManufacturerId = SINGLE_VALUE filter on every query. When reviewing the cosmos docs, re: chosing the correct partition strategy, there seems to be 2 main points. - Choose a partition key with a high cardinality - Choose a

CosmosDB SQL query that matches multiple values in an array

Deadly 提交于 2019-12-12 13:36:30
问题 I am working with Cosmos DB and I want to write a SQL query that will match multiple values in an array. To elaborate, imagine you have the following collection: [ { "id": "31d4c08b-ee59-4ede-b801-3cacaea38808", "name": "Oliver Queen", "occupations": [ { "job_title": "Billionaire", "job_satisfaction": "pretty good" }, { "job_title": "Green Arrow", "job_satisfaction": "meh" } ] }, { "id": "689bdc38-9849-4a11-b856-53f8628b76c9", "name": "Bruce Wayne", "occupations": [ { "job_title":