C'è un modo per fare il mapping delle relazioni tra i modelli in Sails.js?Sails.js - Mappatura da uno a molti
Ecco quello che vorrei:
Video.js:
module.exports = {
attributes: {
filename: 'STRING',
length: 'INTEGER',
watchCount: 'INTEGER',
extension: 'STRING'
user: // I wan to reference to my User.js model
}
};
E nei miei user.js:
module.exports = {
attributes: {
username: {
type: 'email',
required: true
},
password: 'STRING',
videos: // I would like to have an array of videos after querying a user
}
};