I'm getting my head stuck in a twist with this one...
I'm trying to convert my req.query I get in Express which is an object to make an array of objects so I can pass these through to SQL Server as inputs for stored procedures.
This is the data I have -
{ param1: 'testing123', param2: 'poooool', param300: 'nnnvncn' }
I want it to appear like
[{param1: 'testing123'},{param2: 'poooool'},{param300: 'nnnvncn'}]
Any idea how I would get to the desired array above?
EDIT: This is the code I went for in the end running in node.js
app.get('/:client/storedproc/:sp', function(req, resp){
var sp = req.params.sp;
var obj = req.query;
var test = function(){ return Object.keys(obj).map(k => ({ [k]: obj[k] }));}
var arr = test();
console.log(arr)
});