gpt4 book ai didi

javascript - Dynamodb错误: Scan Results don't filter to HASH even though I put in an Actual entry ID

转载 作者:行者123 更新时间:2023-11-28 03:06:56 25 4
gpt4 key购买 nike

我已连接到这个本地我用 Lambda 使用此代码创建的发电机

console.log('Starting Function Now');
const AWS = require("aws-sdk");
const docClient = new AWS.DynamoDB.DocumentClient({region: 'us-east-1'})

exports.handler = function(event,ctx,callback){

let scanParameters = {
"TableName": "Accommodation_Request",
"FilterExpression": "SSD_ID = :val",
"ExpressionAttributeValues": {":val": {"N": "2"}},
"ProjectionExpression": 'SSD_ID,AI_Org_ID'
};

console.log(scanParameters)

console.log("Your Student information");
docClient.scan(scanParameters, function(err,data){
if(err){
callback(err, null)
} else{
callback(null,data)
}
});
};

运行 Lambda 后,我得到了这个结果

{
"Items": [],
"Count": 0,
"ScannedCount": 5
}

问题:我无法返回 SSD_ID = 1 的正确扫描结果

最佳答案

可能是因为您在过滤器中使用字符串而不是数字,或者您有复合分区键

关于javascript - Dynamodb错误: Scan Results don't filter to HASH even though I put in an Actual entry ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60532190/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com