var aws = require('aws-sdk');
var docClient = new aws.DynamoDB.DocumentClient({region: 'ap-northeast-1'});
exports.handler = function (event, context) {
var params = {
TableName: "Thread",//表名
IndexName: "thread-lastupadate_time-index",//GSI 索引名
KeyConditionExpression: "thread = :thread",//GSI 分区键
ExpressionAttributeValues: {
":thread": "thread" //需查询的分区键值
},
};
docClient.query(params, function(err, data) {
if (err) {
console.log(err, err.stack);
}else {
console.log("Query succeeded.");
console.log(data);
context.succeed(data);
}
});
};
来源:CSDN
作者:音羽\
链接:https://blog.csdn.net/qq_44730442/article/details/104157237