Return query as array - NodeJS

0

I have this query that I do in my REST API which lists the items in the following way.

Inquiry

SELECT 'i'.'name', 'i'.'id', 'i'.'img', 'd'.'url', GROUP_CONCAT(t.name SEPARATOR ', ') as tags FROM 'demos' i INNER JOIN 'details' d ON 'i'.'id' = 'd'.'demo_id'  INNER JOIN tags t ON t.demo_id = i.id  GROUP BY 'i'.'id' ORDER BY 'i'.'id' ASC LIMIT " + req.params.limit

Result

{
    "name": "unintento",
    "id": "yiouq9",
    "img": "https://xxx.s3.amazonaws.com/demos/1490370081236",
    "url": "http://192.168.0.66:9966/cms/demos",
    "tags": "PHP, Joomla"
  },

Basically instead of being returned separated by commas, it is returned as a ARRAY . What is the way to do this?

    
asked by Santiago D'Antuoni 29.03.2017 в 23:55
source

0 answers