7.3.2. Output format

7.3.2.1. Summary

Commands output their result as JSON, MessagePack, XML or TSV format.

JSON and MessagePack output have the same structure. XML and TSV are their original structure.

JSON or MessagePack is recommend format. XML is useful for visual result check. TSV is just for special use. Normally you doesn’t need to use TSV.

7.3.2.2. JSON and MessagePack

This secsion describes the structure of command result on JSON and MessagePack format. JSON is used to show structure because MessagePack is binary format. Binary format isn’t proper for documenataion.

JSON and MessagePack uses the following structure:

[HEADER, BODY]

For example:

[
  [
    0,
    1337566253.89858,
    0.000355720520019531
  ],
  [
    [
      [
        1
      ],
      [
        [
          "_id",
          "UInt32"
        ],
        [
          "_key",
          "ShortText"
        ],
        [
          "content",
          "Text"
        ],
        [
          "n_likes",
          "UInt32"
        ]
      ],
      [
        2,
        "Groonga",
        "I started to use groonga. It's very fast!",
        10
      ]
    ]
  ]
]

In the example, the following part is HEADER:

[
  0,
  1337566253.89858,
  0.000355720520019531
]

The following part is BODY:

[
  [
    [
      1
    ],
    [
      [
        "_id",
        "UInt32"
      ],
      [
        "_key",
        "ShortText"
      ],
      [
        "content",
        "Text"
      ],
      [
        "n_likes",
        "UInt32"
      ]
    ],
    [
      2,
      "Groonga",
      "I started to use groonga. It's very fast!",
      10
    ]
  ]
]

7.3.2.2.2. BODY

BODY content depends on the executed command. It may be omitted.

BODY may be an error message on error case.

7.3.2.3. XML

TODO

7.3.2.4. TSV

TODO

7.3.2.5. See also