What is the best way to use json postgresql datatype through the query builder in CakePHP?

I have not found a way to use the json operators the postgresql, ->, ->>etc.

I expected that I could use them this way:

$this->MyModel->find('all', array('conditions'=>array("jsonfield->'key'"=>"value")

But this leads to an error, for example:

Error: SQLSTATE[42703]: Undefined column: 7 ERROR: column MyModel.jsonfield->'key' does not exist LINE 1

+4
source share

Source: https://habr.com/ru/post/1613350/


All Articles