I am using the following function to put some data into dynamo DB table but I am getting this response that Put number first function responds with this: Promise { pending } Here is the code
async function putNumberFirst(phoneNumber) {
return new Promise(function(resolve, reject) {
console.log("inside put Numer function");
let params = {
TableName: process.env.CHAT_DATA_TABLE,
Item: {
'phoneNumber': phoneNumber
}
};
console.log("PARAMS", params);
docClient.put(params, function(err, results) {
if (err) {
console.error(
"Unable to put new connection data. Error:",
JSON.stringify(err, null, 2)
);
reject();
}
else {
console.log("Put succeeded.", results);
resolve("Success!");
}
});
});
}
any help would be appreciated