azure-cosmosdb-sqlapi

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

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

Unauthorized status while accessing Cosmos Db Collection Documents in power shell

心已入冬 提交于 2020-04-17 20:50:32
问题 I am trying to access azure cosmos db account collection documents and also each document in collection. I had referred below link and changed all necessary cosmos db values like databaseid,container,itemid master key etc., Link: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/PowerShellRestApi/PowerShellScripts/ReadItem.ps1 But i am getting below error while running in Powershell. Error: StatusCode: 401 Exception Message: The remote server

How to Query Cosmos DB graph by use of SQL CONTAINS

倾然丶 夕夏残阳落幕 提交于 2020-03-03 05:37:05
问题 I have a Cosmo DB graph where I would like to access the 'name' field in an expression using the string matching CONTAINS in Cosmos DB. CONTAINS works at 1 level as in matching CONATINS SELECT s.label, s.name FROM s WHERE CONTAINS(LOWER(s.name._value), "cara") AND s.label = "site" I also tried with a UDF function SELECT s.label, s.name FROM s WHERE(s.label = 'site' AND udf.strContains(s.name._value, '/cara/i')) I don't get any hits or syntax errors from Cosmos DB even that should be at least

How to find Duplicate documents in Cosmos DB

元气小坏坏 提交于 2020-01-25 04:19:12
问题 I have seen like a huge amount of data write to cosmos DB from stream analytics job on a particular day. It was not supposed to write huge amount of documents in a day. I have to check if there is duplication of documents on that particular day. Is there any query/any way to find out duplicate records in cosmos DB? 回答1: Is there any query/any way to find out duplicate records in cosmos DB? Quick answer is YES.Please use distinct keyword in the cosmos db query sql.And filter the _ts (System

Cosmos DB queries - using ORDER BY when a property does not exist in all documents

若如初见. 提交于 2020-01-23 16:44:26
问题 We are experiencing an issue in when writing queries for Cosmos Document DB and we want to create a new document property and use it in an ORDER BY clause If, for example, we had a set of documents like: { "Name": "Geoff", "Company": "Acme" }, { "Name": "Bob", "Company": "Bob Inc" } ...and we write a query like SELECT * FROM c ORDER BY c.Name this works fine and returns both documents However, if we were to add a new document with an additional property: { "Name": "Geoff", "Company": "Acme" }

Sql api is not supported for this database Error

假如想象 提交于 2020-01-16 09:11:32
问题 I'm trying to execute a query in Cosmo DB Mongo API, using the Cdata ODBC through Python. Below is the driver configuration: [CData ODBC Driver for Cosmos DB] Description=CData ODBC Driver for Cosmos DB 2019 Driver=/opt/cdata/cdata-odbc-driver-for-cosmosdb/lib/libcosmosdbodbc.x86.so UsageCount=1 Driver64=/opt/cdata/cdata-odbc-driver-for-cosmosdb/lib/libcosmosdbodbc.x64.so This is the code I'm using to make the query: import pyodbc cnxn = pyodbc.connect("DRIVER={CData ODBC Driver for Cosmos DB

Sql api is not supported for this database Error

南楼画角 提交于 2020-01-16 09:11:21
问题 I'm trying to execute a query in Cosmo DB Mongo API, using the Cdata ODBC through Python. Below is the driver configuration: [CData ODBC Driver for Cosmos DB] Description=CData ODBC Driver for Cosmos DB 2019 Driver=/opt/cdata/cdata-odbc-driver-for-cosmosdb/lib/libcosmosdbodbc.x86.so UsageCount=1 Driver64=/opt/cdata/cdata-odbc-driver-for-cosmosdb/lib/libcosmosdbodbc.x64.so This is the code I'm using to make the query: import pyodbc cnxn = pyodbc.connect("DRIVER={CData ODBC Driver for Cosmos DB

How to update values in cosmosdb as output using azure stream analutics?

别说谁变了你拦得住时间么 提交于 2020-01-16 08:38:28
问题 at first event I get data like below { 'product_name':'hamam', 'quantity':'100' } at second I get data like below { 'product_name':'hamam', 'quantity':'70' } here I wanna update the values in cosmos db, how can I do it? 回答1: ASA supports upserts feature for cosmos db if your data contains a unique document id.(Your sample data seems does not have it) Please see this paragraph about upserts in ASA for cosmos db. Some excerpt as below: Stream Analytics integration with Azure Cosmos DB allows