Set raw = true on Sequelize Model.create

前端 未结 3 991
青春惊慌失措
青春惊慌失措 2021-02-08 22:26

I want to be able to receive the plain raw object after calling Model.create on Sequelize, the object itself that was created, no metadata or any other things. Just

3条回答
  •  花落未央
    2021-02-08 22:32

    You can also use .toJSON() on the model instance that's returned from the query. http://docs.sequelizejs.com/class/lib/model.js~Model.html#instance-method-toJSON

提交回复
热议问题