I need to scan my table in dynamodb using filtering. I found many examples in internet but when I try use them I have the same error all the time.
filter := expression.Name("CreatedDate").LessThan(expression.Value(time.Now().UTC()))
expr, err := expression.NewBuilder().WithFilter(filter).Build()
if err != nil {
panic(err)
}
out, err := svc.Scan(context.TODO(), &dynamodb.ScanInput{
TableName: aws.String(tableName),
FilterExpression: expr.Filter(),
ExpressionAttributeNames: expr.Names(),
ExpressionAttributeValues: expr.Values(),
})
if err != nil {
panic(err)
}
On expr.Names() and expr.Values() I got error
Cannot use 'expr.Names()' (type map[string]*string) as the type map[string]string
Thank you in advance!