有一个 'accounts' 表,其中 'data'::jsonb 字段填充:
{
"cars": [{"body": "E-JZA80-ALFQZ",
"year": 1999,
"brand": "Toyota",
"model": "Vista Ardeo"}
],
"name": "Gilbert Moore",
"phone": "+13222314555"
}
我尝试类似:
select * from accounts where data->'cars' @> '{"brand":"Toyota"}'
但它没有显示记录。错过了什么?