sequelize mysql json type

Solutions on MaxInterview for sequelize mysql json type by the best coders in the world

showing results for - "sequelize mysql json type"
Marvin
18 Nov 2020
1	@sequelize.AllowNull(false)
2	@sequelize.Column(DataTypes.JSON)
3	get personalInformation(): PersonalInformation {
4		return JSON.parse(this.getDataValue('personalInformation'))
5	}
6
7	set personalInformation(val: any) {
8		this.setDataValue('personalInformation', JSON.stringify(val))
9	}
10
11	@sequelize.AllowNull(false)
12	@sequelize.Column(DataTypes.JSON)
13	get workExperinces(): WorkExperince[] {
14		return JSON.parse(this.getDataValue('workExperinces'))
15	}
16
17	set workExperinces(val: any) {
18		this.setDataValue('workExperinces', JSON.stringify(val))
19	}