Available in versions: Dev (3.20) | Latest (3.19) | 3.18

JSON_KEYS

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The JSON_KEYS function is a non-standard JSON function inspired by MySQL's JSON_KEYS function, which can be used to extract keys of a JSON object into an JSON array.

SELECT json_keys(json_object(
  KEY 'a' VALUE 1
  KEY 'b' VALUE 2
))
create.select(jsonKeys(jsonObject(
          key("a").value(1),
          key("b").value(2))))
      .fetch();

The result would look like this:

+-----------+
| json_keys |
+-----------+
| ["a","b"] |
+-----------+
jsonKeys(jsonObject(key("a").value(1), key("b").value(2)))

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo