murex Shell Docs

Command Reference: struct-keys

Outputs all the keys in a structure

Description

struct-keys outputs all of the keys in a structured data-type eg JSON YAML, TOML, etc. The output is a JSON array of the keys.

Usage

<stdin> -> struct-keys -> <stdout>

Examples

» set: json example={
      "firstName": "John",
      "lastName": "Smith",
      "isAlive": true,
      "age": 27,
      "address": {
          "streetAddress": "21 2nd Street",
          "city": "New York",
          "state": "NY",
          "postalCode": "10021-3100"
      },
      "phoneNumbers": [
          {
              "type": "home",
              "number": "212 555-1234"
          },
          {
              "type": "office",
              "number": "646 555-4567"
          },
          {
              "type": "mobile",
              "number": "123 456-7890"
          }
      ],
      "children": [],
      "spouse": null
  }
» $example -> struct-keys
[
    "/lastName",
    "/isAlive",
    "/age",
    "/address",
    "/address/state",
    "/address/postalCode",
    "/address/streetAddress",
    "/address/city",
    "/phoneNumbers",
    "/phoneNumbers/0",
    "/phoneNumbers/0/type",
    "/phoneNumbers/0/number",
    "/phoneNumbers/1",
    "/phoneNumbers/1/number",
    "/phoneNumbers/1/type",
    "/phoneNumbers/2",
    "/phoneNumbers/2/type",
    "/phoneNumbers/2/number",
    "/children",
    "/spouse",
    "/firstName"
]

See Also

This site is rebuilt weekly, the content is automatically generated from murex's source code. Last built on Mon May 25 06:11:51 UTC 2020 against commit aa3f3b7aa3f3b7e471543754fdcaf910d4920cad9112b91. Downloadable murex binaries are also built weekly. Current version is 0.48.0120 BETA which has been verified against 29375 tests.