【发布时间】:2015-09-07 06:10:26
【问题描述】:
我不确定我是否在标题中使用了正确的术语,但这是我想要从中检索数据的原始结果。
{ items:
[ { name: 'keydose',
keys: 69,
cid: 0,
$created': '2015-06-21T19:20:38.833Z',
' $updated': '2015-06-21T19:20:38.833Z' } ] }
这是通过使用 twitch-irc-db 模块和 node.js 的 twitch-irc 库创建的,通过执行以下操作接收上面的输出:
db.where('users', {name: user.username}).then(function(result) {
console.log(result);
});
我尝试使用 console.log(result.items.cid)、console.log(result.items.cid[0]) 和 console.log(result.items.cid.valueOf()) 来获取数据库中 cid 的值,但我不知道还有什么可以尝试的,我已经用谷歌搜索了很长时间,但找不到任何东西。
感谢您的宝贵时间 :)
【问题讨论】:
标签: javascript arrays node.js object