Answer the question
In order to leave comments, you need to log in
Sequelize return fields on bulkCreate()?
Hello. Don't tell me. Is it possible to return fields in Sequelize with bulkCreate() ? For example, I need to return an id which is auto-incrementing?
const response = await models.Cartridge.bulkCreate([
{ quantity, active },
{ quantity, active },
{ quantity, active }
]);
Answer the question
In order to leave comments, you need to log in
Bulk by itself returns nothing if all is well. Try an additional request to pull out the value you need
PostgreSQL
MySQL
docs.sequelizejs.com/class/lib/model.js~Model.html...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question