I have a requirement to modify a JSON to a JSON having the values in a SQL query format. To better explain.
{
"CASE_0": {"fact_dark":"CHC_Fill"},
"CASE_2": {"Itc_sun":"SEA_Ont"}
}
The result should be having the json values as an sql query leaving the keys as it is. So the resulting query will be:
{
CASE_0: "fact_dark = 'CHC_Fill'",
CASE_2: "Itc_sun = 'SEA_Ont'"
}
I could've proceeded with regex but I couldn't figure it out well. Any elegant ES6 based solution to this?. Please folks help me out on this. TIA
knex.js(if building queries from js objects is a common problem in your app)