简体   繁体   English

如何使用azure流分析查询语言更新cosmos db中的值?

[英]How to update values in cosmos db using azure stream analytics query language?

I'm looking to update data using azures stream analytics query lanuage, for example, at the first event, my data will be like below, 我希望使用azures流分析查询语言更新数据,例如,在第一次事件中,我的数据如下所示,

{
 'Name':'product1',
'sales':100
}

at the second event 在第二场比赛

{
  'name':'product1'
   'sales':200
}

and I wanna sum sales for both of the event, for example, 我想总结两个事件的销售额

{
  'name':'product1',
  'sales':200
}

I take this case as an extension of this case: How to update values in cosmosdb as output using azure stream analutics? 我将这种情况作为这种情况的扩展: 如何使用Azure流分析将cosmosdb中的值更新为输出? to the words i mentioned before, ASA supports upserts feature for cosmos db if your data contains a unique document id. 用我之前提到的话来说,如果您的数据包含唯一的文档ID,则ASA支持cosmos db的upserts功能。 For you, if your Name property is unique key, it could be applied. 对您来说,如果您的Name属性是唯一键,则可以应用它。

However,you wanna sum function now, Azure Function output in ASA could be applied.You could pass the unique Name and the sales as params into Azure Function,then query the data with unique Name and do the sum calculate.Finally,update the data by the unique Name . 但是,您现在想要求sum函数,可以应用ASA中的Azure函数输出 。您可以将唯一的Namesales作为参数传递给Azure Function,然后使用唯一的Name查询数据并进行总和计算。最后,更新数据通过唯一的Name

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Stream Analytics输出到Azure Cosmos DB - Azure Stream Analytics output to Azure Cosmos DB 如何使用 cosmos db azure 的日志分析找到更高 RU 的负责任查询 - how to find responsible query for higher RUs using log analytics of cosmos db azure 将集合的TTL设置为ON时,无法通过Azure流分析作业更新Cosmos DB集合 - Unable to Update Cosmos DB collection by Azure Stream Analytics Job when TTL is set as ON for the collection 没有数据从 Azure stream 分析推送到 Cosmos DB - No data getting pushed from Azure stream analytics to Cosmos DB 将数据推送到 Cosmos DB 时 Azure 流分析作业降级 - Azure Stream Analytics Job degrading while pushing data to cosmos DB 如何使用 Azure Databricks 访问 Azure Cosmos DB 分析存储? - How can I access Azure Cosmos DB Analytics Store using Azure Databricks? 使用 Azure Cosmos DB 匹配多个值 - Matching multiple values using Azure Cosmos DB 如何更新Azure Cosmos DB中的集合 - How to Update Collections in Azure Cosmos DB Azure Stream 分析:如何在运行时和以编程方式更新查询? - Azure Stream Analytics: How can I update Query at runtime and Programmatically? Mongo db 更新查询在 azure cosmos db 中的嵌入式文档中不起作用 - Mongo db update query is not working in embedded documents in azure cosmos db
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM