Dev Helpers
← Back

List leaf paths in a nested configuration

List leaf paths in a nested configuration using SQLite JSON functions.

Open this example in the interactive library

Source code

SELECT fullkey,atom FROM json_tree('{"limits":{"cpu":2},"regions":["ca","uk"]}') WHERE type NOT IN ('array','object') ORDER BY fullkey;

Sample output

[
  {
    "fullkey": "$.limits.cpu",
    "atom": 2
  },
  {
    "fullkey": "$.regions[0]",
    "atom": "ca"
  },
  {
    "fullkey": "$.regions[1]",
    "atom": "uk"
  }
]