1. MooseStack
  2. Data Types
  3. Nested Types

On this page

UsageMultiple LevelsSee Also

Nested Types

Nested types allow embedding complex objects within table rows. Nested types store each field as a separate array column, which can impact query performance for high-throughput paths. Consider Named Tuples for simpler structures stored inline.

Usage

Define a separate model and use it as a field type.

interface Address {  street: string;  city: string;  zip: string;  country: string;} interface User {  name: string;  email: string;  address: Address;    // Nested type}

Multiple Levels

Nested types can contain other nested types.

interface Coordinates {  lat: number;  lng: number;} interface Address {  street: string;  city: string;  location: Coordinates;    // Nested within nested} interface User {  name: string;  address: Address;}
Nested vs JSON

Use nested types when the structure is known and fixed. Use JSON for dynamic or variable structures.

See Also

  • Tuples — Lightweight inline structured data
  • JSON — Dynamic or semi-structured data
  • ClickHouse Nested — ClickHouse official documentation
    • Overview
    • Quick Start
    • Templates / Examples
    Fundamentals
    • Moose Runtime
    • MooseDev MCP
    • Data Modeling
    MooseStack in your App
    • App / API frameworks
    Modules
    • Moose OLAP
    • Moose Streaming
    • Moose Workflows
    • Moose APIs
    Deployment & Lifecycle
    • Moose Migrate
    • Moose Deploy
    Reference
    • API Reference
    • Data Types
      • Strings
      • LowCardinality
      • Integers
      • Floats
      • Decimals
      • Booleans
      • Date & Time
      • Network
      • Arrays
      • Maps
      • Nested
      • Tuples
      • Enums
      • Geometry
      • JSON
      • Nullable
      • Aggregates
    • Table Engines
    • CLI
    • Configuration
    • Observability Metrics
    • Help
    • Changelog
    Contribution
    • Documentation
    • Framework
    FiveonefourFiveonefour
    Fiveonefour Docs
    MooseStackTemplates
    Changelog
    Source506