In the continuation of the updateattributes method, is it possible to update only one attribute in the table?

I tried (sequelize model) to update the values ​​in the table, but it will only update one value in the table. Check out below example

employee.updateAttributes({first_name : value.first_name},
            {last_name : value.last_name},
            {email : value.email},
            {password : value.password},
            {phone : value.phone}
            ).on('success',function(employee){
    message.message = "Employee updated successfully";
    message.employee = employee;
    message.successMessage = "Success";
    callback(message);
})

      

+3


source to share


2 answers


You must specify one object



employee.updateAttributes({
  first_name : value.first_name,
  last_name : value.last_name,
  email : value.email,
  password : value.password,
  phone : value.phone
})

      

+7


source


use .update () instead of .updateAttributes ()



0


source







All Articles