1
我在我的應用程序中使用了sequelize。我有postgres作爲底層數據庫。 但是,當我試圖挽救我得到了以下錯誤實例使用postgresql保存數組進行續集
[錯誤:缺少維度值]
我有以下型號
module.exports = function(sequelize, DataTypes) {
var Mymodel = sequelize.define('Mymodel', {
id: {type : DataTypes.INTEGER, autoIncrement : true, primaryKey: true},
title: {
type: DataTypes.STRING(128),
validate: {
notNull: true,
notEmpty: true
}
},
tags: DataTypes.ARRAY(DataTypes.TEXT)
});
return Mymodel;
}
我發送HTTP POST請求爲
{
"title":"Test challenge",
"tags" : "['JAVA','REST','API']"
}
我是這樣保存對象
Mymodel.create(model).success(function(model) {
callback(null, challenge);
}).error(function(err) {
callback(err, null);
});