azure-cosmosdb

How can I use LINQ in CosmosDB SDK v3.0 async query?

自古美人都是妖i 提交于 2020-05-12 19:42:22
问题 I've been following the official documentation here: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-get-started#Query But I can't figure out how to correctly use a LINQ expression instead on an SQL string. I experimented with GetItemLinqQueryable, but I don't know if is the right way to use it. Also is not async. var db = Client.GetDatabase(databaseId); var container = db.GetContainer(containerId); var q = container.GetItemLinqQueryable<Person>(); var result = q.Where(p => p.Name ==

CosmosDB + group by

余生颓废 提交于 2020-05-08 20:00:47
问题 I need to use " GROUP BY " clause on Azure Data Explorer but I think it is unsupported . Someone have any idea to solve or avoid group by? Best regards, 回答1: Finally, Azure Cosmos DB currently supports GROUP BY in .NET SDK 3.3 or later. Support for other language SDK's and the Azure Portal is not currently available but is planned. <group_by_clause> ::= GROUP BY <scalar_expression_list> <scalar_expression_list> ::= <scalar_expression> | <scalar_expression_list>, <scalar_expression> 回答2: There

CosmosDB + group by

不问归期 提交于 2020-05-08 19:58:25
问题 I need to use " GROUP BY " clause on Azure Data Explorer but I think it is unsupported . Someone have any idea to solve or avoid group by? Best regards, 回答1: Finally, Azure Cosmos DB currently supports GROUP BY in .NET SDK 3.3 or later. Support for other language SDK's and the Azure Portal is not currently available but is planned. <group_by_clause> ::= GROUP BY <scalar_expression_list> <scalar_expression_list> ::= <scalar_expression> | <scalar_expression_list>, <scalar_expression> 回答2: There

Janusgraph using Gremlin query in .net core 3.0

孤者浪人 提交于 2020-04-29 03:28:46
问题 We currently use gremlin.net library in a net core 3.0 application to connect to Janusgraph db. We need to execute below query in janusgraph g.V('12345').outE('myedge').has('datetime',lt(1581922847)).order().by('datetime', incr).limit(100).valueMap().as('time').inV().as('user').select('time','user') The query runs fine as long as we dont have inV() part. If we have inV() , we are facing below error, ScriptEvaluationError: java.util.LinkedHashMap cannot be cast to org.apache.tinkerpop.gremlin

Janusgraph using Gremlin query in .net core 3.0

懵懂的女人 提交于 2020-04-29 03:28:17
问题 We currently use gremlin.net library in a net core 3.0 application to connect to Janusgraph db. We need to execute below query in janusgraph g.V('12345').outE('myedge').has('datetime',lt(1581922847)).order().by('datetime', incr).limit(100).valueMap().as('time').inV().as('user').select('time','user') The query runs fine as long as we dont have inV() part. If we have inV() , we are facing below error, ScriptEvaluationError: java.util.LinkedHashMap cannot be cast to org.apache.tinkerpop.gremlin

Unauthorized access while accessing Azure Cosmos DB to get specific document using Query in power shell

风格不统一 提交于 2020-04-18 06:11:12
问题 With reference to below link, i am trying to modify Github sample to get specific document by providing query option in Body. Link: https://docs.microsoft.com/en-us/rest/api/cosmos-db/querying-cosmosdb-resources-using-the-rest-api Github Sample: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/PowerShellRestApi/PowerShellScripts/ReadItem.ps1 I had modified code like below: Add-Type -AssemblyName System.Web Function Generate

Unauthorized access while accessing Azure Cosmos DB to get specific document using Query in power shell

落爺英雄遲暮 提交于 2020-04-18 06:11:05
问题 With reference to below link, i am trying to modify Github sample to get specific document by providing query option in Body. Link: https://docs.microsoft.com/en-us/rest/api/cosmos-db/querying-cosmosdb-resources-using-the-rest-api Github Sample: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/PowerShellRestApi/PowerShellScripts/ReadItem.ps1 I had modified code like below: Add-Type -AssemblyName System.Web Function Generate

Azure Cosmos DB UDF for date time is seriously slowing down query

那年仲夏 提交于 2020-04-17 21:46:43
问题 Our dates are stored as: "2/22/2008 12:00:00 AM" . We need to filter results so that we get documents between two times. If we compare two queries, one using a UDF and the other not, the one with the UDF is orders of magnitude slower. With: SELECT DISTINCT c.eh, c.wcm, w AS wt FROM c JOIN w IN c.wt WHERE (udf.toValue(w.ced) BETWEEN udf.toValue('03/02/2023') AND udf.toValue('09/02/2023')) AND w.ty = 'FW' OFFSET 0 LIMIT 10 And without: SELECT DISTINCT c.eh, c.wcm, w AS wt FROM c JOIN w IN c.wt

Azure Cosmos DB UDF for date time is seriously slowing down query

血红的双手。 提交于 2020-04-17 21:41:23
问题 Our dates are stored as: "2/22/2008 12:00:00 AM" . We need to filter results so that we get documents between two times. If we compare two queries, one using a UDF and the other not, the one with the UDF is orders of magnitude slower. With: SELECT DISTINCT c.eh, c.wcm, w AS wt FROM c JOIN w IN c.wt WHERE (udf.toValue(w.ced) BETWEEN udf.toValue('03/02/2023') AND udf.toValue('09/02/2023')) AND w.ty = 'FW' OFFSET 0 LIMIT 10 And without: SELECT DISTINCT c.eh, c.wcm, w AS wt FROM c JOIN w IN c.wt

Is there any way to write custom or native queries in Java JPA (DocumentDbRepository) while firing a query to azure-cosmosdb?

爱⌒轻易说出口 提交于 2020-04-17 21:25:47
问题 Connected to azure-cosmosdb and able to fire default queries like findAll() and findById(String Id) . But I can't write a native query using @Query annotation as the code is not considering it. Always considering the name of the function in respository class/interface. I need a way to fire a custom or native query to azure-cosmos db. ?! Tried with @Query annotation. But not working. List<MonitoringSessions> findBySessionID(@Param("sessionID") String sessionID); @Query(nativeQuery = true,