DynamoDB - SerializationException,负载中的意外值类型
DynamoDB - SerializationException, Unexpected value type in payload
我正在尝试使用主键和排序键查询 dynamodb table。不涉及 GSI。但是得到以下异常。你能帮我解决这个问题吗?
{
"__type": "com.amazon.coral.service#SerializationException",
"Message": "Unexpected value type in payload"
}
这是查询的负载。这里context是主键,id是排序键。
{
"TableName": "vsm.data",
"KeyConditionExpression": "context = :e AND begins_with(id, :m)",
"ExpressionAttributeValues": {
":e": "event",
":m": "sdafsd"
}
}
找到问题了。表达式属性值映射需要数据类型和值。所以请求应该是
{
"TableName": "vsm.data",
"KeyConditionExpression": "context = :e AND begins_with(id, :m)",
"ExpressionAttributeValues": {
":e": {"S": "event"},
":m": {"S": "sdafsd"}
}
}
我正在尝试使用主键和排序键查询 dynamodb table。不涉及 GSI。但是得到以下异常。你能帮我解决这个问题吗?
{
"__type": "com.amazon.coral.service#SerializationException",
"Message": "Unexpected value type in payload"
}
这是查询的负载。这里context是主键,id是排序键。
{
"TableName": "vsm.data",
"KeyConditionExpression": "context = :e AND begins_with(id, :m)",
"ExpressionAttributeValues": {
":e": "event",
":m": "sdafsd"
}
}
找到问题了。表达式属性值映射需要数据类型和值。所以请求应该是
{
"TableName": "vsm.data",
"KeyConditionExpression": "context = :e AND begins_with(id, :m)",
"ExpressionAttributeValues": {
":e": {"S": "event"},
":m": {"S": "sdafsd"}
}
}