Can anyone help me with an issue I'm facing when using double dollar in a query with JSON_EXTRACT?
Here is my query:
const user = await UserModel.findOne({
where: where(fn('JSON_EXTRACT', col('config'), '$.type'), type),
attributes: ['id'],
})
The resulting query looks like this:
SELECT `id` FROM `users` WHERE JSON_EXTRACT(`config`, '$$.type') = 'admin' LIMIT 1;
I am encountering a problem with the double $$. Is this specific to the issue at hand or am I doing something incorrectly?