Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update instance in sequelize

const jane = await User.create({ name: "Jane" });
jane.favoriteColor = "blue"
await jane.update({ name: "Ada" })
// The database now has "Ada" for name, but still has the default "green" for favorite color
await jane.save()
// Now the database has "Ada" for name and "blue" for favorite color
Source by sequelize.org #
 
PREVIOUS NEXT
Tagged: #update #instance #sequelize
ADD COMMENT
Topic
Name
3+2 =