📜  getObject 返回精确值而不是 JSON 对象 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:31.492000             🧑  作者: Mango

代码示例1
//----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);