Skip to content

Commit 0f660c2

Browse files
Merge pull request #229431 from ealsur/users/ealsur/functiondocsv4
Updating v4 samples
2 parents dcd6f5c + 92993da commit 0f660c2

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

articles/azure-functions/functions-bindings-cosmosdb-v2-trigger.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Cosmos DB trigger for Functions 2.x and higher
33
description: Learn to use the Azure Cosmos DB trigger in Azure Functions.
44
ms.topic: reference
5-
ms.date: 11/29/2022
5+
ms.date: 03/03/2023
66
ms.devlang: csharp, java, javascript, powershell, python
77
ms.custom: devx-track-csharp, devx-track-python, ignite-2022
88
zone_pivot_groups: programming-languages-set-functions-lang-workers
@@ -77,9 +77,10 @@ Apps using [Azure Cosmos DB extension version 4.x](./functions-bindings-cosmosdb
7777
```cs
7878
namespace CosmosDBSamplesV2
7979
{
80+
// Customize the model with your own desired properties
8081
public class ToDoItem
8182
{
82-
public string Id { get; set; }
83+
public string id { get; set; }
8384
public string Description { get; set; }
8485
}
8586
}
@@ -106,7 +107,7 @@ namespace CosmosDBSamplesV2
106107
if (input != null && input.Count > 0)
107108
{
108109
log.LogInformation("Documents modified " + input.Count);
109-
log.LogInformation("First document Id " + input[0].Id);
110+
log.LogInformation("First document Id " + input[0].id);
110111
}
111112
}
112113
}
@@ -186,17 +187,21 @@ Here's the binding data in the *function.json* file:
186187
Here's the C# script code:
187188

188189
```cs
189-
#r "Microsoft.Azure.DocumentDB.Core"
190-
191190
using System;
192-
using Microsoft.Azure.Documents;
193191
using System.Collections.Generic;
194192
using Microsoft.Extensions.Logging;
195193

196-
public static void Run(IReadOnlyList<Document> documents, ILogger log)
194+
// Customize the model with your own desired properties
195+
public class ToDoItem
196+
{
197+
public string id { get; set; }
198+
public string Description { get; set; }
199+
}
200+
201+
public static void Run(IReadOnlyList<ToDoItem> documents, ILogger log)
197202
{
198203
log.LogInformation("Documents modified " + documents.Count);
199-
log.LogInformation("First document Id " + documents[0].Id);
204+
log.LogInformation("First document Id " + documents[0].id);
200205
}
201206
```
202207

0 commit comments

Comments
 (0)