有一个information
具有这种结构的 JSONB 字段:
{
"ignore"=>false
}
我想获取其ignore
字段为的所有记录true
:
@user.posts.where("information ->> 'ignore' = TRUE")
此行会引发错误:
PG::UndefinedFunction: ERROR: operator does not exist: text = boolean
我在谷歌中找不到任何东西。我们到处都在谈论文本意义。但是布尔值没有任何意义。