Skip to content

Error when using range() and whereJsonHasAny() #213

@purepear

Description

@purepear

This works fine
Model.query().whereJsonHasAny('someJsonField', 'someKey').then(...)
but this doesn't
Model.query().range(0, 10).whereJsonHasAny('someJsonField', 'someKey').then(...)
Here is the error:
select count(*) as "count" from (select * from "Model" where "someJsonField"#>'{}' $1| array['someKey']) as temp - syntax error at or near "$1"

I think when range is making the count query it replaces ?| with$1| and causes the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions