I am getting the following results from SELECT query to a table in a MySQL db:
[
RowDataPacket {
id: 1,
title: 'foo',
date: 2012-07-06T08:40:14.000Z
},
RowDataPacket {
id: 2,
title: 'foo',
date: 2021-12-16T16:00:12.000Z
},
RowDataPacket {
id: 3,
title: 'foo',
date: 2012-07-06T08:40:14.000Z
},
RowDataPacket {
id: 4,
title: 'foo',
date: 2019-12-02T14:13:41.000Z
},
RowDataPacket {
id: 5,
title: 'foo',
date: 2019-11-25T12:46:25.000Z
},
RowDataPacket {
id: 6,
title: 'foo',
date: 2021-12-17T16:00:12.000Z
},
RowDataPacket {
id: 7,
title: 'foo',
date: 2021-12-15T16:00:12.000Z
}
]
How can I return this within a response to an API call without it being returned as [object, object]?
I want to return it without it being a string as a string isn't that useable compared to JSON.