We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Querying a JSON column with condition operators is not currently supported and results in a wrong query.
To Reproduce Steps to reproduce the behavior:
// 'data' is JSON column and 'created_at' is nested field await myRepository.count({ data: { created_at: { $lte: '2020-02-23T16:00:33.036Z', }, }, });
// myEntity.ts (entity definition) interface Data { created_at: string; } @Entity({ tableName: 'mytable' }) export default class MyEntity extends BaseEntity { @Property({ type: 'json' }) data: Data; }
Generated query is:
select count(distinct("e0"."id")) as "count" from "mytable" as "e0" where "data"->'created_at'->>'$lte' = '2020-02-23T16:00:33.036Z'
$lte is misunderstood as a nested field of created_at field.
$lte
created_at
Expected behavior
select count(distinct("e0"."id")) as "count" from "mytable" as "e0" where "data"->>'created_at' >= '2020-02-23T16:00:33.036Z'
Versions
The text was updated successfully, but these errors were encountered:
cb5e715
B4nan
No branches or pull requests
Describe the bug
Querying a JSON column with condition operators is not currently supported and results in a wrong query.
To Reproduce
Steps to reproduce the behavior:
Generated query is:
$lte
is misunderstood as a nested field ofcreated_at
field.Expected behavior
Versions
The text was updated successfully, but these errors were encountered: