The Guide for Time Series Data Projects is out.

Download now
Skip to content

Nested Data Structure

Object data is a commonly used and universally applicable data type due to its flexibility, readability, and ease of use. It is present in various use cases such as Industrial IoT, log analysis, and video analytics

CrateDB simplifies working with object data by enabling nested data. There is no need for data transformation, as CrateDB empowers direct utilization of data streams, eliminating the need to alter the data's original format.
CrateDB SQL with Objects

Objects may contain arrays, and arrays may contain objects. With CrateDB, all these nested structures can be selected and queried very easily.

insert into locations (id, name, position, kind, inhabitants, information)
values (16, 'Folfanga', 4, 'Star System',
    {name = 'A-Rth-Urp-Hil-Ipdenu',
     description = 'A species of small slug',
     interests = ['lettuce', 'slime']},
    [{evolution_level=42, population=1},
    {evolution_level=6, population=3600001}]
select name, inhabitants[1]['interests'] from locations
where name = 'Folfanga';
| name     | inhabitants[1]['interests'] |
| Folfanga | lettuce                     |
Watch the live demo (timestamp 4:58–17:30) of unleashing the power of nested objects in CrateDB for an IoT use case. Also read CrateDB for IoT >

Product documentation

Nested Structures

Additional resources

On-demand video

Unleashing the Power of Nested Data

Timestamp:  4:58 – 17:30

Interested in nested data structure?