You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON path extraction is handling wildcard tokens incorrectly #14747
No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.
Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
This isn't a bug, the JSON path syntax that sequelize proposes is not the same as the ones the different dialects use, it only supports simple paths (no wildcard) by design to be compatible with all dialects
In Sequelize 7 (after #15598), you'll be able to write your own json path function to use mysql's syntax:
Activity
github-actions commentedon Jul 27, 2022
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
WikiRik commentedon Aug 13, 2022
I can reproduce this by the following failing test in
test/unit/sql/where.test.ts;According to the MySQL docs this is indeed valid JSON path syntax; https://dev.mysql.com/doc/refman/5.7/en/json.html#json-path-syntax
We should add the wildcard tokens in the
jsonPathExtractionQueryfunction of the MySQL query generator.Other dialects might have the same issue but I haven't looked into them.
If somebody wants to pick this up, feel free!
[-]json path double quote wrong[/-][+]JSON path extraction is handling wildcard tokens incorrectly[/+]ephys commentedon Jan 27, 2023
This isn't a bug, the JSON path syntax that sequelize proposes is not the same as the ones the different dialects use, it only supports simple paths (no wildcard) by design to be compatible with all dialects
In Sequelize 7 (after #15598), you'll be able to write your own json path function to use mysql's syntax: