是否可以为模型属性(列)设置别名?
//User.js
attributes: {
favoriteDog: {
type: 'string',
alias: 'fav_dog' //in sails console this specific syntax doesn't do anything
}
}
...
User.find({where: {id: 45}}).exec(function(row) {
console.log(row.favoriteDog);
console.log(row.fav_dog); //should get same value
});
我无法在文档中找到任何内容。