Skip to main content
The Insert To Children command (Command Type: 1013) maps specific parent attributes to child objects using JSONPath queries and a key mapping configuration.

Overview

The Insert To Children command provides functionality for:
  • Selecting parent objects with a JSONPath query
  • Selecting child objects within each parent with a JSONPath query
  • Copying specific parent attributes into each child object using mapping rules

Command Type

Command Type ID: 1013

Parameters

ParameterTypeDescriptionRequired
querystringJSONPath query to select parent objects from the data attributeYes
keyChildrenstringJSONPath query to select child objects from each parentYes
mappingArray of KeyMappingDefines how parent attributes are copied to child objectsYes

KeyMapping

FieldTypeDescriptionRequired
tostringThe new key to which the extracted value will be assignedYes
fromstringA JSONPath query string to extract the value from the parentNo

Usage Examples

Insert Event Fields into Markets

{
  "command": "insert-to-children",
  "params": {
    "query": "$.events[*]",
    "keyChildren": "$.markets[*]",
    "mapping": [
      { "from": "$.id", "to": "eventId" },
      { "from": "$.startTime", "to": "eventStartTime" }
    ]
  }
}

Insert League Info into Fixtures

{
  "command": "insert-to-children",
  "params": {
    "query": "$.leagues[*]",
    "keyChildren": "$.fixtures[*]",
    "mapping": [
      { "from": "$.leagueId", "to": "leagueId" },
      { "from": "$.leagueName", "to": "leagueName" },
      { "from": "$.sportId", "to": "sportId" }
    ]
  }
}

Common Use Cases

  • Hierarchy Flattening: Propagate parent identifiers into nested children
  • Data Enrichment: Attach parent context to child records for downstream processing
  • Denormalization: Combine parent and child fields into flat records for sink commands