Support condition objects in utility functions #6666 (#6685)
https://github.com/sequelize/sequelize/issues/6666 Makes it possible to pass condition objects (e.g. {foo: 'bar'}) to Sequelize.fn(), Sequelize.cast(). This makes it easy to use conditional counts in Sequelize queries, e.g. Sequelize.fn('sum', {name: 'Fred'}) which results in SUM(`name` = 'Fred') which can be used in attribute definition to count entities for which the condition matches.
Showing
with
126 additions
and
11 deletions
-
Please register or sign in to post a comment