Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex property names in JSON queries require quoting #4264

Closed
B4nan opened this issue Apr 24, 2023 · 0 comments
Closed

Complex property names in JSON queries require quoting #4264

B4nan opened this issue Apr 24, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@B4nan
Copy link
Member

B4nan commented Apr 24, 2023

Describe the bug
When querying JSON properties, they sometimes require quoting, e.g. when the property name starts with a number.

https://mikroorm.slack.com/archives/CFSAF8DEX/p1682066001116079

To Reproduce
Try to query JSON property that starts with a number.

// generates
select `j0`.* from `jwt` as `j0` where `j0`.`jwt_data`->'$.4mh:Login:Type' = 'SecureDownloadLink' and `j0`.`jwt_data`->'$.4mh:SecureDownloadLink:Id' = '8768c9a0-542d-4ac7-b0a9-7b4b627a6fb1'
// but it should be
select `j0`.* from `jwt` as `j0` where `j0`.`jwt_data`->'$."4mh:Login:Type"' = 'SecureDownloadLink' and `j0`.`jwt_data`->'$."4mh:SecureDownloadLink:Id"' = '8768c9a0-542d-4ac7-b0a9-7b4b627a6fb1'
@B4nan B4nan added the bug Something isn't working label Apr 24, 2023
@B4nan B4nan closed this as completed in a94bbce Apr 25, 2023
jsprw pushed a commit to jsprw/mikro-orm-full-text-operators that referenced this issue May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant