SQLite3- I have a users table and a songNodes table. A user can favorite songs, and a user can 'fork' songs. I have two separate junction tables that represent these unique by purpose but otherwise identical relationships.
Sequelize- The only way I know how to perform a junction query in sequelize is as follows-
var myForks = function(userId, callback) {
User.findOne({
where: {
id: userId
}
})
.then(function(userObj) {
userObj.getSongNodes() //this is where I need to specify
.then(function(stuff) { //a junction table
callback(stuff);
})
})
};
I have tried to research this extensively and I can not find a way to specify which junction table I want to use with the automatically generated function 'getSongNodes.' Any help/guidance would be greatly appreciated!