Closed Nicopiwi closed 6 months ago
@Nicopiwi Thank you for posting the question here and apologies for the time it took us to respond. There are multiple ways to represent your query in Sequelize. While in your example it looks nicer to add the filtering under the association, moving the filters to the top-level allows more complex queries, such as having OR
between different filters applied on different associations. To read more about the options available in Sequelize: https://sequelize.org/docs/v6/advanced-association-concepts/eager-loading/#complex-where-clauses-at-the-top-level. Feel free to reach out if you have further questions.
In the
@bitovi/sequelize-querystring-parser
package apparently I cannot filter by a deep nested attribute. Using the IBM Style queryinclude=route&filter=equals(route.name, 'hello')
, I'm getting the following object:When I should get the following Object: