We've run into a scenario lately where we're trying to filter a collection based on the count of a child collection.
For example, we want to filter users who are assigned to groups. Based on the OData specification, the $count query option or length operator are available to get counts on collections.
For reference how to use these, refer to:
Does anyone have thoughts on how something like this might be implemented to a Sequelize query?
Thanks!
We've run into a scenario lately where we're trying to filter a collection based on the count of a child collection.
For example, we want to filter
userswho are assigned togroups. Based on the OData specification, the$countquery option orlengthoperator are available to get counts on collections.For reference how to use these, refer to:
GET /users?$filter=groups/$count gt 0GET /users?$filter=groups/$countGET /users?$filter=length(groups) gt 0Does anyone have thoughts on how something like this might be implemented to a Sequelize query?
Thanks!