【发布时间】:2020-09-29 02:49:28
【问题描述】:
我的表中有一个列如下:
{
1:{type: 0},
2:{type: 1}...
}
我尝试过使用 whereJsonContains('table.column->type', 0) 但它不起作用,
whereRaw("table->column @> '{\"type\": 0}'::jsonb"); 也不起作用,我猜是因为嵌套的 json 结构。我怎样才能做到这一点?
【问题讨论】:
-
您是否尝试过:
->whereJsonContains('your.column', ['type' => '0'])? -
我试过了,但也没用
标签: laravel postgresql eloquent laravel-query-builder