How could I use the sequelize.fn with the MySQL function `FIND_IN_SET`
See original GitHub issueI have a query and an update query using the MySQL Function FIND_IN_SET
, but the manual does not file a usage aboud this.
The query like:
sequelize.query('SELECT * FROM house WHERE FIND_IN_SET(:uid, users)',
{replacements: {uid: uid},
type: sequelize.QueryTypes.SELECT}).then(function (houses) {
})
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
How to use FIND_IN_SET in sequelize with mysql DB
An example for the FIND_IN_SET in sequelize row query: sequelize.query("select ...
Read more >Node.js MySQL FIND_IN_SET() Function - GeeksforGeeks
FIND_IN_SET () function is a built-in function in MySQL that is used to get the position of the first occurrence of value string...
Read more >Model Querying - Basics - Sequelize
You can use sequelize.fn to do aggregations: Model.findAll({ attributes: [ 'foo', [sequelize.fn('COUNT', sequelize.col('hats')), 'n_hats'],
Read more >MySQL FIND_IN_SET Function with Practical Examples
In this tutorial, you will learn how to use the MySQL FIND_IN_SET function to return the position of a string in a comma-separated...
Read more >Querying - Manual | Sequelize
findAll({ attributes: [[sequelize.fn('COUNT', sequelize.col('hats')), 'no_hats']] }); SELECT COUNT(hats) AS no_hats ... When using aggregation function, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sushantdhiman Thx for your reply, the below is I’m using in my project: