Method: Sequel::Postgres::JSONBOp#path_query

Defined in:
lib/sequel/extensions/pg_json_ops.rb

#path_query(path, vars = nil, silent = nil) ⇒ Object

Returns a set of all jsonb values specified by the JSON path for the json object.

json_op.path_query("$.foo")
# jsonb_path_query(json, '$.foo')

json_op.path_query("$.foo ? ($ > $x)", x: 2)
# jsonb_path_query(json, '$.foo ? ($ > $x)', '{"x":2}')

json_op.path_query("$.foo ? ($ > $x)", {x: 2}, true)
# jsonb_path_query(json, '$.foo ? ($ > $x)', '{"x":2}', true)
[View source]

727
728
729
# File 'lib/sequel/extensions/pg_json_ops.rb', line 727

def path_query(path, vars=nil, silent=nil)
  _path_function(:jsonb_path_query, path, vars, silent)
end