1 回答
TA贡献1831条经验 获得超4个赞
您应该使用表达式生成器:
// todo: please check if value should be converted to another type in your case
keyCond := expression.Key("unix_time").LessThenEqual(expression.Value("1558130473454419"))
proj := expression.NamesList(expression.Name("id"), expression.Name("num_users"), expression.Name("salesforce_campaign"), expression.Name("unix_time"))
expr, err := expression.NewBuilder().
WithKeyCondition(keyCond).
WithProjection(proj).
Build()
if err != nil {
fmt.Println(err)
}
input := &dynamodb.QueryInput{
ExpressionAttributeValues: expr.Values(),
KeyConditionExpression: expr.KeyCondition(),
ProjectionExpression: expr.Projection(),
TableName: aws.String(table),
}
- 1 回答
- 0 关注
- 104 浏览
添加回答
举报