📅  最后修改于: 2022-03-11 15:03:31.492000             🧑  作者: Mango
//----this is the part u need to get the value of the s3 object instead of a JSON or payload undefined----
var s3 = new AWS.S3();
var params = {
Bucket: 'iot-es-data',
// Delimiter: '/',
Prefix: 'iot-data'
}
var count = 0;
s3.listObjects(params, function (err, data) {
if(err)throw err;
// console.log(data);
var c = data;
var a = c.Contents;
console.log(c.Contents[0]);
//----Case Sensitive------
console.log(a.Key);