Document.js
module.exports = {
attributes: {
type: {
type: 'string'
},
createdBy: {
model: 'User',
required: true
},
body: {
type: 'string'
},
comments: {
model: 'Comments'
},
metaInfo: {
type: 'json'
}
}};
我想知道是否有任何方法可以编写像上面给出的模型,这样我就可以向metaInfo添加一个json对象,该对象包含一个名称-值对。
例: json:{ name:'Project',value:'MyFirstProject'}
这有可能穿过水道吗?
提前谢谢。
发布于 2014-12-01 10:23:22
我相信这个评论回答了你的问题。如果您需要进一步的帮助,您可以参考Sails页面:JSON字符串阵列中提出的这个问题的答案。
https://stackoverflow.com/questions/27186353
复制相似问题