Created
November 15, 2017 00:03
-
-
Save todgru/ea8a44d3eb6f6dd5f5fcca40e210a36f to your computer and use it in GitHub Desktop.
sequelize through table this is how a query on a column of a through table works. can't query directly on the through table.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.models.myItem.findAll({ | |
where: { projectId: 1 }, | |
include: [ | |
{ | |
model: this.models.myItemThing, | |
// Sequelize term indicates "use the through table where `type===foo`" | |
through: { | |
where: { type: "foo" }, | |
}, | |
}, | |
], | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment