I have this knex
update:
update = async (noteId, text, db) => (
db.knex('notes')
.returning([
'id',
'note',
'user_id',
'product_id',
'timestamp',
])
.where('id', noteId)
.update({
timestamp: new Date(),
note: text,
})
);
In the returned data I wish to include product_name
. This has to come from a product table which is joined on notes.product_id = product.id
. How do I do this through knex
?