This is the table partition key setting
The table content
When I tried to get an item from the table, it prints this error
botocore
I guess you don't have to put all the related attributes
in my case I only have one PK as col
const AWS = require('aws-sdk');
const ddb = new AWS.DynamoDB.DocumentClient();
exports.handler = (event, context, callback) => {
const connectionId = event.requestContext.connectionId;
deleteConnectionId(connectionId).then(() => {
callback(null, { statusCode: 200 , message: 'userId deleted'});
});
};
function deleteConnectionId(connectionId) {
return ddb
.delete({ TableName: 'your table name',
Key: {
userId : connectionId.toString() // userId is my PK in this case
}
} )
.promise();
}