Method: Sequel::Postgres::JSONBaseOp#is_json
- Defined in:
- lib/sequel/extensions/pg_json_ops.rb
permalink #is_json(opts = OPTS) ⇒ Object
Return whether the json object can be parsed as JSON.
Options:
- :type
-
Check whether the json object can be parsed as a specific type of JSON (:value, :scalar, :object, :array).
- :unique
-
Check JSON objects for unique keys.
json_op.is_json # json IS JSON
json_op.is_json(type: :object) # json IS JSON OBJECT
json_op.is_json(unique: true) # json IS JSON WITH UNIQUE
319 320 321 |
# File 'lib/sequel/extensions/pg_json_ops.rb', line 319 def is_json(opts=OPTS) _is_json(IS_JSON, opts) end |