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.