azure-cosmosdb

ExecuteNextAsync freezes/hangs in Azure Cosmos DB [duplicate]

人盡茶涼 提交于 2019-12-13 04:40:59
问题 This question already has answers here : An async/await example that causes a deadlock (5 answers) Closed 11 months ago . When you create a new cosmos DB some code samples are shown in Azure. Most of the code works. However I have this single function that just freezes/hangs when Executed. Any ideas how to solve or troubleshoot? Code: public async Task<IEnumerable<T>> GetItemsAsync(Expression<Func<T, bool>> predicate, string collection) { IDocumentQuery<T> query = Client.CreateDocumentQuery<T

Proxy Issues while Dumping Data into CosmosDB from Dataframe using intelliJ

安稳与你 提交于 2019-12-13 04:27:07
问题 I have to dump json data into cosmosDB from spark dataframe using scala and intelliJ. I am reading a csv file from my local machine and converting it into json format. Now I have to dump this json data into cosmosDB collection. Spark version is 2.2.0 and scala version is 2.11.8 Below is the code which I wrote in IntelliJ with scala for fetching a csv file from my local machine and convert it into a json file. import org.apache.spark.sql.SparkSession import com.microsoft.azure.cosmosdb.spark

Return the content of a specific object in an array — CosmosDB

淺唱寂寞╮ 提交于 2019-12-13 04:26:34
问题 This is a follow up to question 56126817 My current query SELECT c.EventType.EndDeviceEventDetail FROM c WHERE c.EventType.EndDeviceEventType.eventOrAction = '93' AND c.EventType.EndDeviceEventType.subdomain = '137' AND c.EventType.EndDeviceEventType.domain = '26' AND c.EventType.EndDeviceEventType.type = '3' AND ARRAY_CONTAINS(c.EventType.EndDeviceEventDetail,{"name": "RCDSwitchReleased","value": "true" }) My Query Output [ { "EndDeviceEventDetail": [ { "name": "Spontaneous", "value": "true"

400 error when upsert using Cosmos SP

天涯浪子 提交于 2019-12-13 04:14:14
问题 I'm trying to execute the below SP function createMyDocument() { var collection = getContext().getCollection(); var doc = { "someId": "123134444", }; var options = {}; options['PartitionKey'] = ["someId"]; var isAccepted = collection.upsertDocument(collection.getSelfLink(), doc, options, function (error, resources, options) { }); } and cosmos keeps on complaining that there's something wrong with the partition key { code: 400, body: '{"code":"BadRequest","message":"Message: {\\"Errors\\": [\\

Is it possible to configure Azure C# function DocumentDB attribute arguments?

与世无争的帅哥 提交于 2019-12-13 03:53:19
问题 I'm building an Azure Http triggered C# function with an output binding to Cosmos DB. My function definition is like this: [FunctionName("HttpTriggerFunction")] public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "post", Route = "myroute")]HttpRequestMessage req, [DocumentDB("database", "collection", ConnectionStringSetting = "CosmosDBConnection")] IAsyncCollector<dynamic> document, TraceWriter log) This works fine. However, I would like to be able to

Issue with cosmos db query using Contains

喜你入骨 提交于 2019-12-13 02:51:22
问题 Issue with the search which has an integer contains predicate clause. I have generated linq expression as below This works fine if the field is a string field. {f => (True AndAlso f.MyStringField.Contains("987"))} But this does not work when i convert it to string. For example i am having an integer field say myIntField. {f => (True AndAlso f.XYZ.myIntField.ToString().Contains("160"))} I have added the piece of code which used for getting the query. It looks like some toString() is getting

CosmosDB throughput limit of single partition?

孤人 提交于 2019-12-13 02:07:43
问题 In the CosmosDB documentation, Microsoft hints at a throughput limit on a single partition, but does not specify the limit. We is the limit?. Here is the relevant documentation: https://docs.microsoft.com/en-us/azure/cosmos-db/partition-data And the relevant quote: Behind the scenes, Azure Cosmos DB provisions partitions needed to serve T requests/s. If T is higher than the maximum throughput per partition t, then Azure Cosmos DB provisions N = T/t partitions. 回答1: Doesn't explicitly answer

DocumentDb “where” clause with mathematical expression

别等时光非礼了梦想. 提交于 2019-12-13 01:28:14
问题 I would like to understand how to create query where clauses on DocumentDB with mathematical comparator inside. For example, I used this demonstrator to understand how to make a "greater than" comparaison : expression AND food.version > 0 seems to work very well. Here is under what I tryed onto portal.azure.com documentdb query explorer and the results. I don't understand why I got an error in some cases(QUERY3), and (in option) how to get error details on portal.azure.com ?! Tested: >>>

How can I empty a CosmosDB collection and fill it again and keep its metrics/logs

旧城冷巷雨未停 提交于 2019-12-13 01:27:22
问题 we have a web service feed that we run daily and saves all documents into a CosmosDB collection, as there is no need for me to keep the old documents as the new feed comes in I am deleting and re creating the collection daily as well, this has some drawbacks The statistics of the collection is reset so app insights and logging becomes useless Its next to impossible to trouble shoot as all logs etc are also reset How can I empty a CosmosDB collection before adding new documents to it so that

Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.0.0.0' when using Gremlin.NET in Azure Functions

点点圈 提交于 2019-12-13 01:26:21
问题 I want to update an Azure CosmosDB Graph from Azure Functions with Gremlin.NET. I'm using 1.0.10 Functions Cli, .NET Framework 4.7.1 and a project with these dependencies: <PackageReference Include="Gremlin.Net" Version="3.3.2" /> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DocumentDB" Version="1.2.0" /> <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="1.2.2-beta3" /> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.13"