hasMany result as single object

12 views
Skip to first unread message

Bala Balu

unread,
Feb 13, 2018, 7:17:11 AM2/13/18
to Sequelize
This is my sample output for join.

{
id: '123',
books.id: 'book123',
book.name: 'duology'
}

But i need output like,

{
id: '123'.
'books': [{
id: 'book123',
name: 'duology'
}]
}

How can we get the result like this?
Reply all
Reply to author
Forward
0 new messages