Nodejs拒绝读取现有对象的属性

时间:2018-03-05 11:28:35

标签: node.js mongodb object

我有一个来自MongoDB的对象:

var result = await dbFind.searchSongs({'name':searchTerm}); //method executed from core module
console.log(result);
/*output:
{
        "_id" : ObjectId("5a99a3bb26a4b92b3cd9f43c"),
        "name" : "Bad Guy",
        "artist" : "Eminem",
        "song" : "1520018363067.mp3",
        "mimetype" : "audio/mp3",
        "views" : [ ],
        "__v" : 0
}
*/

但是当我尝试访问object.property时,我得到undefined。发生了什么事?

0 个答案:

没有答案