我想使用.sailsjs
我试过制作这样的模型Users.js
:
interest:{
type: 'string',
required: false,
columnType: 'array'
}
插入查询如下所示:
Users.create({ interest : ['programming'] });
postgre 表中兴趣列的数据类型是character varying[]
.
当我尝试使用此设置执行插入时,它会引发错误:
Specified value (a array: [ 'programming' ]) doesn't match the expected type: 'string'
如何在 postgresql 表中插入数组,模型应该是什么样子?
任何帮助将不胜感激,谢谢!