79153623

Date: 2024-11-03 20:58:59
Score: 1
Natty:
Report link

Even though the answer from Simon Dold works fine, the better solution compatible with typescript would be to map a Sequelize Model instance to JSON serialisible object, like

const user = await User.findOne({where: {id}}).then(user=>({id: user.id, name: user.name}))

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Wladimir