I am working on nodejs for the first time. I have a scenario where I am having json array like shown below. I will not know how many json items will be there in that array.
I have tried solution using loops but it will fire the query for multiple times. And I don't want that.
{"qualification":[{"degreeName":"B","domain":"p"},{"degreeName":"A","domain":"q"}]}
And mysql query will be like this
INSERT INTO qualification (degreeName,domain) VALUES (B,p),(A,q);
In the above query I have explicitly written values, but as I will not know how many values will be there I can't write values like that, instead i will have to put all values in a variable and then pass it to the query. So how can I retrive and convert qualification data into varible or tuples to put into mysql query so that I can fire single query and add multiple values.