How to convert DynamoDBEvent images to DynamoDBv2.Document
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 503
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 18
Description
### Discussed in https://github.com/aws/aws-lambda-dotnet/discussions/1654
Originally posted by **Dreamescaper** January 16, 2024
I have a lambda subscribed to dynamoDb events. I want to convert event's records to regular JSON, currently we use something like that:
```csharp
public async Task FunctionHandler(DynamoDBEvent input, ILambdaContext context)
{
foreach (var record in input.Records)
{
var image = record.Dynamodb.NewImage;
var document = Document.FromAttributeMap(image);
var json = document.ToJson();
/* .... */
}
}
```
However, it doesn't work after the https://github.com/aws/aws-lambda-dotnet/pull/1648 is merged.
Could anyone suggest what is the easiest way to do same after the update?
Contributor guide
Assessment
This issue has not been assessed yet.