Skip to content

distinct

distinct(array) → array · Array

Remove duplicate values from an array using value equality.

  • array (required): the array to deduplicate
bash
echo '{"tags": ["a", "b", "a", "c", "b"]}' | utlx -e 'distinct($input.tags)'
# ["a", "b", "c"]
utlx
{
  uniqueCustomers: distinct(map($input.orders, (o) -> o.customerId)),
  uniqueStatuses: distinct(map($input.orders, (o) -> o.status))
}

Released under AGPL-3.0.