flat
ArrayFlattens a nested array one level deep. Useful when an API returns arrays-of-arrays or when you pluck an array-valued field from each object.
Syntax
flatUse cases
| Use case | Description | URL | |
|---|---|---|---|
| Flatten nested arrays | Merge a list of sub-arrays into a single flat array. | https://httpip.es/api/pipe/echo:[[1,2],[3,4],[5,6]]|flat | |
| Flatten matrix rows | Collapse a 2D matrix into a 1D list for counting or summing. | https://httpip.es/api/pipe/echo:[[10,20],[30,40],[50,60]]|flat|sum | |
| Merge tag arrays | Combine per-item tag lists into one pool, then deduplicate. | https://httpip.es/api/pipe/echo:[{"tags":["js","ts"]},{"tags":["ts","go"]}]|pluck:tags|flat|distinct|sort | |
| Flatten then count | Flatten and count total elements across all nested arrays. | https://httpip.es/api/pipe/echo:[[1,2,3],[4,5],[6]]|flat|count |