Sequelize upsert
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: i need to get the id for the inserted/updated record when using .upsert() in sequelize. right now .upsert() returns a boolean indicating whether the row was created or updated. return db . VenueAddress . upsert ({ addressId : address . addressId , venueId : venue . venueId , street : address . street , zipCode : address . zipCode , venueAddressDeletedAt : null }). then ( function ( test ){ //test returned here as true or false how can i get the inserted id here so i can insert data in other tables using this new id? }); 回答1: I