Method: Sequel::SQLite::JSONBaseOp#get_json

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

#get_json(key) ⇒ Object

Returns an expression for getting the JSON array element or object field at the specified path as a JSON value.

json_op.get_json(1)         # (json -> 1)
json_op.get_json('a')       # (json -> 'a')
json_op.get_json('$.a.b')   # (json -> '$.a.b')
json_op.get_json('$[1][2]') # (json -> '$[1][2]')


132
133
134
# File 'lib/sequel/extensions/sqlite_json_ops.rb', line 132

def get_json(key)
  self.class.new(json_op(GET_JSON, key))
end