mysqljs / mysql

A pure node.js JavaScript Client implementing the MySQL protocol.
MIT License
18.28k stars 2.52k forks source link

query result #2509

Closed kururu-abdo closed 3 years ago

kururu-abdo commented 3 years ago

hello

i want to know how to get nice json from a query resut let assume that we have tow tables : CUSTOMERS and ORDERS when i query about customer's orders i want to get result like this: { "customer_name":"john dohe" , "orders": [ { "order_id":1 , "order_date" :"12-12-2007" } , { "order_id":2 , "order_date" :"13-12-2007" } , { "order_id":13, "order_date" :"14-12-2007" } ,

]

}

how to achieve that?

mbaumgartl commented 3 years ago

This is out of scope of this module. You have to do it on your own.

dougwilson commented 3 years ago

StackOverflow would be a good place for tgis type of question.