1. MooseStack
  2. Data Types
  3. Map Types

On this page

UsageType Mapping Reference

Map Types

Maps store key-value pairs with specified key and value types.

Usage

interface User {  preferences: Record<string, string>;     // Map(String, String)  metrics: Record<string, number>;         // Map(String, Float64)  settings: Record<string, boolean>;       // Map(String, Boolean)}

Type Mapping Reference

ClickHouse TypeTypeScriptPython
Map(String, String)Record<string, string>Dict[str, str]
Map(String, Float64)Record<string, number>Dict[str, float]
Map(String, Int64)Record<string, Int64>Dict[str, int]
Map(String, Boolean)Record<string, boolean>Dict[str, bool]
Key types

Map keys must be String, Int*, or UInt* types. String keys are most common.

When to use Map vs JSON

Use Map when all values have the same type and you need efficient key lookups. Use JSON when values have mixed types or the structure is highly dynamic.

FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506
  • 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