Is it possible to pass a condition to the findAll query include array?
For example, I have UsersModel, PostsModel and UserVotesModel.
Users can vote on their posts.
For a registered user, I want to request messages and only include voting for the current user. I cannot do this using Sequelize include param. Sequelize combines posts and UserVotes in postId, but for this particular request I want to join both postId and UserId.
Any ideas how to solve this problem?
source share