mysql如何插入一个数组?(nodejs + vue)

表结构是这样的:

这两个字段存的是数组数据
前端每次发请求前都要转为string

// 数组=>string(前端代码)
this.ruleForm.contact = JSON.stringify(this.ruleForm.contact);
this.ruleForm.images = JSON.stringify(this.ruleForm.images);

拿到数据后又要JSON.parse()转换

如果不转换的话sql就会报错

感觉这样来回转换好麻烦,有好的解决方法么?

最佳答案