我有一个带有行foo
的DynamoDB表。现在,我将获得该行内所有项目的总和。因此,我在NodeJS
应用程序中编写了此函数。
exports.count_items = function () {
let params = {
TableName: dynamodbTableName,
KeyCondition: '# ??? = : ???',
ExpressionAttributeNames: {
'# ???': ' ??? '
},,
Select: 'COUNT'
}
dynamodb.query(params, function (err, data) {
if (err) {
console.log('Eror by gettin all items' + err)
} else {
console.log('Currenty ' + data + 'items')
}
})
}
要在该行中获取所有项目,我应该在KeyCondition
和ExpressionAttributesNames
中写些什么?