Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sequelize inner join

User.hasMany(Post, {foreignKey: 'user_id'})
Post.belongsTo(User, {foreignKey: 'user_id'})

Post.find({ where: { ...}, include: [User]})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sequelize #join
ADD COMMENT
Topic
Name
9+2 =