I am trying to update a sequelize model partially that contains a string array value separated by semicolons.
languages: {
type: Sequelize.STRING,
allowNull: false,
get() {
if (this.getDataValue('languages') === null) {
return [];
} else {
return this.getDataValue('languages').split(';');
}
},
set(val) {
if (val.length === 0) {
this.setDataValue('languages', null);
} else {
this.setDataValue('languages', val.join(';'));
}
},
},