TO STREAM

In a data query, you can use the TO STREAM operator to generate a stream of elements from a list.

This page discusses:

See Also
Expression Language
Defining Data Queries

Input

In a stream of E elements, each element contains a list of F elements.

Output

For each E element, the output returns a list of F elements. If the input element is NULL, the output for this element is empty.

General Parameters

Parameter Description
Label

Specify the label to display below the operator type in the data query.

Description

Add a description to display as tooltip on hover over the operator icon.

Tip: It is useful to explain what the operator does, especially when you share the data query with other users.
Operator input variable Specify the name to give to the variable that contains the input data. The variable is then available when you define expressions.

Stream Criteria Parameters

Parameter Description
Collection to flatten Specify the list attribute to flatten. For each input element, the operator retrieves the list and outputs each element in the list one by one. For one element in input, you get several elements in output (as many as there are in the list).

Example: You are querying friends and you want to get a stream with their names.

Collection to flatten: item.friends

Input elements:

  • {name: "Bob", friends: ["Lea", "Alice", "Betty"]}
  • {name: "Albert", friends: ["John"]}

Output elements:

  • "Lea"
  • "Alice"
  • "Betty"
  • "John"
Output expression Optional. Configure an expression to transform the elements before the output.

The goal is to combine the input element specified in the Operator input variable with the output element represented by a variable called value. For each element in the list, the operator evaluates the expression and generates the transformed output.

Example: You have a list of persons linked with their friends, and you want to generate pairs of friends in the output.

Collection to flatten: item.friends

Output expression: {person: item.name, friend: value}

Input elements:

  • {name: "Bob", friends: ["Lea", "Alice", "Betty"]}
  • {name: "Albert", friends: ["John"]}

Output elements:

  • {person:"Bob", friend:"Lea"}
  • {person:"Bob", friend:"Alice"}
  • {person:"Bob", friend:"Betty"}
  • {person:"Albert", friend:"John"}