Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Reading and Writing Large JSON Files Using JSON Cursors

Introduction

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

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

Related articles

Please see the following articles for more information:

Try It!

Under the Coder Navigator, expand the examples package entry and navigate to the code folder. Afterwards, look for the jsonCursor package. This package contains models and Gloop services 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; jsonCursor.output.WriteComplexJson.gloop service for JSON output cursors.

How It Works...

Reading a large JSON file could potentially take quite some time and memory to process. The example services provided fast it is to read a large JSON file using JSON cursors.