【发布时间】:2019-08-05 14:05:15
【问题描述】:
我创建了一个 azure 函数,当新文档添加到集合时会触发该函数。
public static void Run(IReadOnlyList<Document> input, ILogger log)
{
if (input != null && input.Count > 0)
{
log.LogInformation("Documents modified " + input.Count);
log.LogInformation("First document Id " + input[0].Id);
}}
是否可以从该集合中选择一个特定的文档,然后查询该所选文档中的数据?
例如。在名为clothingcollection 的集合中,我有一个id 为:12345Tops 的文档。我想查询文档中找到的id为:12345Tops的数据。
或者检索集合中的第一个文档,然后查询第一个选择的文档
我查看了带有 http 触发器的 azure 函数:https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb#trigger---attributes
但我需要使用 cosmosdb 触发器,因为这需要在将文档添加到集合时触发。
【问题讨论】:
标签: azure-functions azure-cosmosdb