Skip to content

count

count(array) → number · Array

Count all elements in an array.

  • array (required): the array to count
bash
echo '{"orders": [{"status": "ACTIVE"}, {"status": "CLOSED"}, {"status": "ACTIVE"}]}' \
  | utlx -e 'count($input.orders)'
# 3
utlx
{
  totalOrders: count($input.orders),
  totalItems: count($input.items)
}

Released under AGPL-3.0.