Method: Sequel::Postgres::JSONBOp#set

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

#set(path, other, create_missing = true) ⇒ Object

Returns a json value for the object at the given path.

jsonb_op.set(['a', 'b'], h) # jsonb_set(jsonb, ARRAY['a', 'b'], h, true)
jsonb_op.set(['a', 'b'], h, false) # jsonb_set(jsonb, ARRAY['a', 'b'], h, false)


370
371
372
# File 'lib/sequel/extensions/pg_json_ops.rb', line 370

def set(path, other, create_missing=true)
  self.class.new(function(:set, wrap_input_array(path), wrap_input_jsonb(other), create_missing))
end