How to access a RowDataPacket object

前端 未结 14 2409
悲&欢浪女
悲&欢浪女 2020-11-29 03:02

I\'m currently developing a desktop application with Node-webkit. During that process I need to get some data from a local MySQL-database.

The querying works fine, b

14条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 03:11

    I had this problem when trying to consume a value returned from a stored procedure.

    console.log(result[0]);
    

    would output "[ RowDataPacket { datetime: '2019-11-15 16:37:05' } ]".

    I found that

    console.log(results[0][0].datetime);
    

    Gave me the value I wanted.

提交回复
热议问题