Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

save specific attributes in table: sequelize

const user = await User.create({
  username: 'alice123',
  isAdmin: true
}, { fields: ['username'] });
// let's assume the default of isAdmin is false
console.log(user.username); // 'alice123'
console.log(user.isAdmin); // false
Source by sequelize.org #
 
PREVIOUS NEXT
Tagged: #save #specific #attributes #sequelize
ADD COMMENT
Topic
Name
8+3 =