I want to do a bulk insert into MySQL. I have followed this question as well for understanding. The user has posted an answer which takes array of data and then inserting into DB.
I have a data stored like this
'116':
{
lat: '31.53867',
long: '74.41279666666667',
timestamp: '2018-07-28 15:56:15'
},
'117':
{
lat: '31.53863',
long: '74.41278',
timestamp: '2018-07-28 15:56:20'
},
'118':
{
lat: '31.538645',
long: '74.41285',
timestamp: '2018-07-28 15:58:39'
}
}
Since I am new in node so I have no idea how can I put whole dictionary into the database.
Or If not possible then how can I convert data to this format so It can be inserted into query
var values = [
['31.53863', '74.41285', '2018-07-28 15:58:39'],
['31.53863', '74.41285', '2018-07-28 15:58:39'],
['31.53863', '74.41285', '2018-07-28 15:58:39']
];
Any help would be really appreciated.