I am doing a select query on MySQL database using NodeJS. How can I get the expected result? I want to erase >> {title:} <<
What I want:
['test1','test2']
My code:
app.get('/info', function(request, response){
var query = 'SELECT title FROM community';
db.query(query, function(err, filelist, fields){
if(err) console.log(err);
console.log(filelist);
console.log(JSON.parse(JSON.stringify(filelist));
});
The result I got:
[ TextRow { title: 'test1' }, TextRow { title: 'test2' } ]
[ { title: 'test1' }, { title: 'test2' } ]