Skip to content

join

Module Export

[{key1: value}] join [inner|outer|left|right] [{key2: value}] on key1 == key2

Joins two iterators on a key.

Examples

import 'iterators'
let array1 = [{ id = 1, firstName = 'John' }, { id = 2, firstName = 'Jane' }]
let array2 = [{ id = 1, lastName = 'Doe' }, { id = 2, lastName = 'Doe' }]
from
array1 as `first`
join array2 as second on id
select input => {
id = input.first.id
name = $'{input.first.firstName} {input.second.lastName}'
}

Result:

[{
id = 1
name = 'John Doe'
},{
id = 2
name = 'Jane Doe'
}]