I have created a function to return the Database column value. The function returns value well. But it is not the format that I want. I have explained my problem below by code.
Function:
async function getHtmlNoteContent(quote_id){
try{
const connection = await mysql.createConnection(config.mysql.credentials);
const [note] = await connection.query(`select notes_html from table where id = ${quote_id}`);
connection.end();
console.log('ppppp -->',JSON.stringify(note));
return JSON.stringify(note);
}catch (e) {
utils.error500(req, res, e.message);
}
}
above function return value like this -->
ppppp --> [{"notes_html":"<p>column value</p>"}]
But I want -->
ppppp --> <p>column value</p>
Can someone show me how can I do this? Thank you