BaseModel.toJSON() method
Serializes this instance, honouring the returning column list.
Signature:
toJSON(): any;
Returns:
any
A plain object, ready to send over the wire.
Remarks
Sequelize's own toJSON() emits the loaded attributes. This one also picks up an associated instance, or an array of them, that those attributes do not already cover, and then — if the last write named the columns to return — drops every property that was not named.