Jit*_*hPS 12 amazon-dynamodb boto3
我想在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
});
Run Code Online (Sandbox Code Playgroud)
但我不能尝试使用botot3.
以下是我迄今为止可以实现的目标
response = table.scan(
Select= 'ALL_ATTRIBUTES',
FilterExpression=Attr('CustomerName').begins_with("S")
)
Run Code Online (Sandbox Code Playgroud)
我无法理解如何添加OR条件.如果我添加,则显示错误
Jit*_*hPS 23
对于AND'和'用于和'''|' 用来
response = table.scan(
Select= 'ALL_ATTRIBUTES',
FilterExpression=Attr('CustomerName').begins_with("S") | Attr('CustomerName').begins_with("S")
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25256 次 |
| 最近记录: |