Sequelize: Problem with dobule $ in JSON_EXTRACT

Viewed 849

I'm having a problem with the double dollar in query with JSON_EXTRACT.

My query:

const user = await UserModel.findOne({
    where: where(fn('JSON_EXTRACT', col('config'), '$.type'), type),
    attributes: ['id'],
})

the result looks like this:

SELECT `id` FROM `users` WHERE JSON_EXTRACT(`config`, '$$.type') = 'admin' LIMIT 1;

The problem is in double $$. Is this a problem specific or am I doing something wrong?

1 Answers
Related