How to convert Amazon.DynamoDBv2.DocumentModel.Document to Dictionary<string, Amazon.Lambda.DynamoDBEvents.DynamoDBEvent.AttributeValue> ? #1675
-
To simplify dev testing of stream processors on their system, we convert a JSON string to a Amazon.DynamoDBv2.DocumentModel.Document, then call the ToAttributeMap() method to convert it to a Dictionary<string, Amazon.Lambda.DynamoDBEvents.DynamoDBEvent.AttributeValue> and assign it to the image: var json = @"{
""rk"": ""rk value"",
""pid"": ""pid guid"",
...
}";
var record = JsonConvert.DeserializeObject<Dictionary<string, DynamoDBEntry>>(json);
var recordDocument = new Document(record);
var dynamoDbEvent = new DynamoDBEvent()
{
Records = new List<DynamodbStreamRecord>()
{
new DynamodbStreamRecord()
{
Dynamodb = new StreamRecord()
{
NewImage = recordDocument.ToAttributeMap()
}
}
}
}; This no longer works after updating to Amazon.Lambda.DynamoDBEvents (3.0.0). Can someone direct me on the new way of doing this? This has some similarities to discussion 1654 and issue 1657. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@Trisped Good afternoon. I think your scenario is similar to what is described in #1700 (this is reviewed with the team and in our backlog). Kindly confirm. |
Beta Was this translation helpful? Give feedback.
@Trisped Thanks. I will mark this discussion as answered since we have tracking feature request #1700.