I am learning Golang to connect dynamodb using AWS-SDK-GO-V2 but I do not understand how to get one item by key.
All example that i saw it is using the v1 but I NEED WITH V2.
I am learning Golang to connect dynamodb using AWS-SDK-GO-V2 but I do not understand how to get one item by key.
All example that i saw it is using the v1 but I NEED WITH V2.
I found the solution in reddit
Example
getItemInput := &dynamodb.GetItemInput{
Key: map[string]types.AttributeValue{
"Id": &types.AttributeValueMemberS{Value: id},
},
TableName: aws.String("TableName"),
ConsistentRead: aws.Bool(true),
ProjectionExpression: aws.String("Id, Name, Timestamp"),
}
AWS SDK Go V2 Developer guide is a good place to start.
Recommend taking a look at https://aws.github.io/aws-sdk-go-v2/docs/getting-started/
© 2022 - 2024 — McMap. All rights reserved.