mysql nodeJS result json format

76 views Asked by At

mysql is returning me result as

    +-------------------+
    column_name
    +-------------------+
    result1
    result2
    +-------------------+

and I am getting result in json format is of this format

    [{"column_name":"result1"},{"column_name":"result2"}]

but I wanted it in json format like this (without using iteration logic)

    [{"column_name":["result1","result2"]}]

Is there any such nodejs mysql method available or json formation module available???

0

There are 0 answers