You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @vthai ! We return an array of RowDataPacket objects because this is a low-level driver library. But regardless, the output you provided above is not JSON because you didn't use a JSON serializer to display it. It looks like you probably used console.dir or console.log, which Node.js uses a different formatting.
Try using this: console.log(JSON.stringify(result))
It might actually help with performance as well. Because all rows are instances of the same RowDataPacket class, they all share same 'hidden class' - see for example http://s3.mrale.ph/nodecamp.eu/#41 for explanation
I am wondering why the query result for a SQL SELECT return something like this:
Shouldn't it just return something a "pure" JSON array like this:
Maybe I am new to Javascript but the one returned by node-mysql doesn't even qualified as JSON object? no colon after RowDataPacket?
The text was updated successfully, but these errors were encountered: