Skip to content

Home

Development

IDEs

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

examples package: Reading and writing large JSON files using JSON cursors

JSON cursors are typically used when reading and writing large JSON data sets. The examples package demonstrates how to use JSON input and output cursors; simply have a look at the services under the jsonCursor.input and jsonCursor.output packages.

Service Description
jsonCursor.input.ReadAndWriteSimpleJson.gloop Creates an input cursor from a JSON string and maps it to another JSON output cursor.
jsonCursor.output.WriteComplexJson.gloop Shows how to use Gloop JSON output cursors.

Related articles

Please see the following articles for more information:

Try it!

In the Navigator, expand the examples package and navigate to the code folder, then expand the jsonCursor package. This package contains the models and Gloop services as shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
examples
├── ...
└── code
    └── jsonCursor
        ├── input
        │   └── ReadAndWriteSimpleJson.gloop
        ├── model
        │   ├── Header.model
        │   ├── Record.model
        │   └── Trailer.model
        └── output
            └── WriteComplexJson.gloop

Open to inspect and run the jsonCursor.input.ReadAndWriteSimpleJson.gloop service to learn how JSON input cursors work; and the jsonCursor.output.WriteComplexJson.gloop service for JSON output cursors. Line and service comments are provided in all of the services for further explanation1.

Explanation

Reading large JSON data sets can potentially take some time and memory to process. The example services provided shows how fast it is to read a large JSON file using JSON cursors.


  1. Open the Gloop service file to see comments. Make sure comments are also not hidden.