JSON
PostgreSQL
JSON_TYPEOF
Mengembalikan tipe dari nilai JSON sebagai text string: object, array, string, number, boolean, atau null.
Tipe hasil:
textSyntax
SQL
JSON_TYPEOF(json)Parameter
jsonjsonwajib
Nilai JSON
Contoh Penggunaan
Check JSON Type
SQL
1 SELECT JSON_TYPEOF('"hello"'::json), JSON_TYPEOF('123'::json), JSON_TYPEOF('{}'::json);
Mengecek tipe berbagai nilai JSON.
Hasil
| json_typeof | json_typeof | json_typeof |
|---|---|---|
| string | number | object |