javascript - Get last inserted id from Sequelize.js "query" (MySQL) -
i'm using sequelize in 1 of projects , having trouble custom non-model query.
for example:
var query = "insert table (name) values ("bob");"; sqlcon.query(query) .on('success', function(result) { console.log(result); // no inserted record or last insert id });
i have inserted record returned me in case or @ least record id. missing make sure "result" gets populated?
try this:
var sequelize = new sequelize('testa', 'testa', 'testa', { dialect: 'mysql', dialectoptions: { flags: '-found_rows' } });
Comments
Post a Comment