Db触发功能可找到要更新文档的确切部分

Db触发功能可找到要更新文档的确切部分

本文介绍了Azure Cosmos Db触发功能可找到要更新文档的确切部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文档Db集合"Coll_1".我还创建了一个Azure cosmos db触发器函数,以便在"Coll_1"中的任何文档更新时检查并采取措施.但是我需要确切地知道从azure函数修改文档的哪一部分.请确认是否支持,否则欢迎为我的问题提供任何解决方案.我当前的功能代码如下:

I have a Document Db collection 'Coll_1' . I have also created a Azure cosmos db trigger function to check and take action whenever any document in 'Coll_1' is updated. However I need to know exact what part of the document is modified from the azure function. Please confirm if that is supported , else any solution for my issue is welcome please . My current function code is below :

    public static class CosmosDBTrigger
{
    [FunctionName("CosmosDBTrigger")]
    public static void Run([CosmosDBTrigger(
        databaseName: "Coll1DB",
        collectionName: "Coll_1",
        ConnectionStringSetting = "DBConnection",
        LeaseCollectionName = "leases")]IReadOnlyList<Document> documents, TraceWriter log)
    {
        if (documents != null && documents.Count > 0)
        {
            log.Verbose("Documents modified " + documents.Count);
            log.Verbose("First document Id " + documents[0].Id);
        }
    }
}

感谢您的任何帮助,并在此先感谢您!

Any help is appreciated and thanks in advance!

推荐答案

目前,尚无办法确定更改Feed中文档的哪个部分已更改.更改Feed在更新/插入操作后返回文档的状态.

At this moment there is no way to identify which part of the document changed in the Change Feed. The Change Feed returns the state of the document after the update/insert operation.

您可以在用户语音(如果您要使用它).

You can vote for this feature in the User Voice if it's a feature you'd like.

这篇关于Azure Cosmos Db触发功能可找到要更新文档的确切部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 18:34