How to access a RowDataPacket object

前端 未结 14 2405
悲&欢浪女
悲&欢浪女 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:12

    Turns out they are normal objects and you can access them through user_id.

    RowDataPacket is actually the name of the constructor function that creates an object, it would look like this new RowDataPacket(user_id, ...). You can check by accessing its name [0].constructor.name

    If the result is an array, you would have to use [0].user_id.

提交回复
热议问题