How do I return JSON data from stored procedure via MySQL Workbench to NodeJS API

48 Views Asked by At

I have created a stored procedure, which has a task to return category related information from serveral tables. Also the SP will do some logic, filtering and mapping. At the end I would like to return the final data as JSON object.

I will select data from 2 tables as below :-

select * from category_details;

select * from category_filters;

I would like to get response in NodeJS

{
    categoryDetails: {
        // whatever I get from "select * from category_details;"
    },
    categoryFilters: select * from category_filters; // as this will be an array
}

I am getting response as below

[
   [// whatever I get from "select * from category_details;"],
   [// whatever I get from "select * from category_filters;"]
]
0

There are 0 best solutions below