You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my question is after i call the model.save() method, how can i get the current model's id ? and mysql db is design to auto_increment.
i was try to use "SELECT LAST_INSERT_ID() as id FROM " after save's callback, but it dosen't suit when concurrent request
The text was updated successfully, but these errors were encountered:
thanks for reply.
you means i can get the id from model instance ?
like this ? var user = User.create(params); user.save(function () { alert(user.id) })
i found the insertId was return throught this.exec(sql, function (err, res) { ,but it dosen't return back to callback, why ? how could i get the insertId
hi :
my question is after i call the model.save() method, how can i get the current model's id ? and mysql db is design to
auto_increment
.i was try to use
"SELECT LAST_INSERT_ID() as id FROM "
after save's callback, but it dosen't suit when concurrent requestThe text was updated successfully, but these errors were encountered: