azure-cosmosdb

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

Cosmos Table API - perform custom scheduled backup

六月ゝ 毕业季﹏ 提交于 2020-01-16 09:11:30
问题 I am using a Cosmos Table API application and I need to backup all the data from all the tables every 15 minutes. How can I do this? 回答1: Since ADF only supports cosmos db sql api and mongo api,not for table api,it seems that you have to consider using Migration Tool. You could follow above example command-line: dt.exe /s:AzureTable /s.ConnectionString:"DefaultEndpointsProtocol=https;AccountName=;AccountKey=" /s.Table:metrics /s.InternalFields:All /s.Filter:"PartitionKey eq 'Partition1' and

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

Query expression is invalid cosmosdb

∥☆過路亽.° 提交于 2020-01-16 08:40:18
问题 I am trying to query using groupby in cosmosdb with the following query, var result = client.CreateDocumentQuery<Login>(documentUri) .Where(i => i.logevent == "Success" && i._ts > 1517405472 && i._ts <= 1518010272) .GroupBy(t => t._ts); it throws the following error DocumentQueryException: Query expression is invalid, expression https://documents.azure.com/dbs/colls/test.Where(i => (((i.logevent == "Success") AndAlso (i._ts > 1517405472)) AndAlso (i._ts <= 1518010272))).GroupBy(t => t._ts) is

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

Azure function with CosmosDBTrigger doesn't seem to be triggered by upserts

a 夏天 提交于 2020-01-15 07:51:19
问题 I'm working with Azure Functions for the first time. I'm trying to write a simple function which responds to documents changed or added to a CosmosDb collection. The function I've written looks like this: [FunctionName("ChangeLog")] public static void Run([CosmosDBTrigger( databaseName: "Recaptcha", collectionName: "Rules", ConnectionStringSetting = "CosmosDBConnection", LeaseCollectionName = null)]IReadOnlyList<RuleConfigCollection> documents) { if (documents != null && documents.Count > 0)

Query CosmosDb Unstructured JSON

假如想象 提交于 2020-01-15 05:13:29
问题 How can CosmosDB Query the values of the properties within a dynamic JSON? The app allows storing a JSON as a set of custom properties for an object. They are serialized and stored in CosmosDb. For example, here are two entries: { "id": "ade9f2d6-fff6-4993-8473-a2af40f071f4", ... "Properties": { "fn": "Ernest", "ln": "Hemingway", "a_book": "The Old Man and the Sea" }, ... } and { "id": "23cb9d4c-da56-40ec-9fbe-7f5178a92a4f", ... "Properties": { "First Name": "Salvador", "Last Name": "Dali",

Query CosmosDb Unstructured JSON

偶尔善良 提交于 2020-01-15 05:13:10
问题 How can CosmosDB Query the values of the properties within a dynamic JSON? The app allows storing a JSON as a set of custom properties for an object. They are serialized and stored in CosmosDb. For example, here are two entries: { "id": "ade9f2d6-fff6-4993-8473-a2af40f071f4", ... "Properties": { "fn": "Ernest", "ln": "Hemingway", "a_book": "The Old Man and the Sea" }, ... } and { "id": "23cb9d4c-da56-40ec-9fbe-7f5178a92a4f", ... "Properties": { "First Name": "Salvador", "Last Name": "Dali",

Cosmos DB - Delete Document with Python

筅森魡賤 提交于 2020-01-15 03:49:29
问题 In this SO question I had learnt that I cannot delete a Cosmos DB document using SQL. Using Python, I believe I need the DeleteDocument() method. This is how I'm getting the document ID's that are required (I believe) to then call the DeleteDocument() method. # set up the client client = document_client.DocumentClient() # use a SQL based query to get a bunch of documents query = { 'query': 'SELECT * FROM server s' } result_iterable = client.QueryDocuments('dbs/DB/colls/coll', query, options)

How to create and update a relation between documents in DocumentDB using ASP.NET Web API

穿精又带淫゛_ 提交于 2020-01-14 05:22:13
问题 I am new to .NET and Azure, and am trying to create a simple Web API, to help me learn. I have two collections of DocumentDB documents. The documents in each collection are defined as follows: public class Log { [JsonProperty(PropertyName = "id")] public string Id { get; set; } [JsonProperty(PropertyName = "studentName")] public string StudentName { get; set; } [JsonProperty(PropertyName = "assignment")] public string Assignment { get; set; } [JsonProperty(PropertyName = "dueDate")] public