且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用azure流分析更新cosmosdb中的值作为输出?

更新时间:2023-02-14 09:06:54

如果您的数据包含唯一的文档ID,ASA支持cosmos db的 upserts 功能.(您的示例数据似乎没有此功能)请参阅此段,关于ASA的宇宙数据库中的upserts.

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.

一些摘录如下:

Stream Analytics与Azure Cosmos DB的集成允许您基于给定的Document ID列在容器中插入或更新记录.

Stream Analytics integration with Azure Cosmos DB allows you to insert or update records in your container based on a given Document ID column.

如果传入的JSON文档具有一个现有的ID字段,则该字段将自动用作Cosmos DB中的Document ID列,并且所有后续写操作都将被处理,从而导致以下情况之一:

If the incoming JSON document has an existing ID field, that field is automatically used as the Document ID column in Cosmos DB and any subsequent writes are handled as such, leading to one of these situations:

  • 唯一ID导致插入
  • 重复的ID和文档ID"设置为"ID"会导致upsert
  • 重复的ID和未设置的文档ID"导致错误之后,第一个文件