我是Sails的新手,面臨模型的一個小問題。
如下我定義一個用戶模型:只在Sails模型中存儲必要的數據
module.exports = {
attributes: {
firstName: {
type: 'string'
},
lastName: {
type: 'string'
},
email: {
type: 'email',
required: true
},
password: {
type: 'String'
},
passwordSalt: {
type: 'String'
},
projects:{
collection: 'ProjectMember',
via: 'userId'
}
}
};
我有一個叫計劃多個模型具有用戶作爲其外交重點:
module.exports = {
planId: { type: 'string'},
userId: { model: 'User'}
};
現在計劃存儲所有用戶數據。有沒有什麼辦法可以限制Plan模型只保留一些用戶的詳細信息,如firstName,lastName,email和projectMembers,而不是存儲其他個人信息。像密碼,passwordSalt等?
由於事先