1 适用于JSON/JSONB
操作符 实例 结果
->整数:选择数组中元素:输出json select ‘[{“a”:“foo”},{“b”:“bar”},{“c”:“baz”}]’::json ->...“foo”}
->text:选择object中的元素:输出json select ‘{“a”: {“b”:“foo”}}’::json -> ‘a’; {“b”:“foo”}
->>整数:选择数组中元素...:输出text select ‘[1,2,3]’::json ->> 2; 3
->>text:选择object中的元素:输出text select ‘{“a”:1,“b”:2}’::json ->>...|text[]:顶级key或数组包含text[]中的任意一个?:输出bool select '{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'd']; t
?...&text[]:顶级key或数组包含text[]中的全部?:输出bool select '["a", "b", "c"]'::jsonb ?