Skip to main content

Select

Aliases: $select, $selectFields, $map

Passes along records with only the specified fields to the next stage in the pipeline. The specified fields can be existing fields from the input records or newly computed fields.

Select existing fields

Declare as an array of strings

[
"uid",
"country",
"q1",
"q2"
]

Select newly calculated fields

Example:

[
// existing fields:
"uid",
"country",
"q1",
"q2",

// newly calculated fields:
{ name: "month", syntax: "getMonth(timestamp)" },
{ name: "q7new", syntax: "wave>=2 ? q7 : null" }
]
note

If the final output stage of your pipeline returns more fields than necessary, it may be wise to select only the required fields. This may improve performance, and it may make field dependency tracking more useful.