【发布时间】:2017-12-10 15:51:31
【问题描述】:
我正在尝试对 dynamodb 进行表扫描 以下是javascript中的代码
var params = {
TableName: 'Contacts',
FilterExpression: 'begins_with(CustomerName,:value)OR begins_with(CustomerName,:val) ',
ExpressionAttributeValues: {
':value': {'S':'S'},
':val':{'S':'E'},
},
Select: 'ALL_ATTRIBUTES',
};
dynamodb.scan(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
但我无法使用 botot3 尝试相同的操作。
以下是我目前所能达到的目标
response = table.scan(
Select= 'ALL_ATTRIBUTES',
FilterExpression=Attr('CustomerName').begins_with("S")
)
我不明白如何添加 OR 条件。如果我添加,它会显示错误
【问题讨论】:
标签: amazon-dynamodb boto3