【发布时间】:2021-06-10 23:31:51
【问题描述】:
最近我使用最新的 AWS SDK 版本 3 更新了我的代码
我有如下在dynamodb中查询的功能:
const query = async ( _eventId, _roomId) => {
var params = {
TableName: 'myTable',
IndexName: 'p_key-status-index',
KeyConditionExpression: 'p_key = :p_key AND #status = :status',
FilterExpression: 'contains(room_id, :room_id)',
ExpressionAttributeNames: marshall({
'#status': 'status'
}),
ExpressionAttributeValues: marshall({
':p_key': _eventId,
':room_id': _roomId,
':status': true
})
};
console.log('getRegSeat :: params: ' + JSON.stringify(params));
try {
let res = await dynamoClient.send(new QueryCommand(params));
console.log('res: ', res);
return true
} catch (e) {
console.log('Error: ' + e);
}
};
我收到一个错误
Error: SerializationException: Start of structure or map found where not expected
欢迎提出任何建议。
【问题讨论】:
标签: node.js amazon-web-services amazon-dynamodb