first
ArrayReturns the first element of an array as a single value, not wrapped in an array. Useful when you expect exactly one result and want to work with the object directly.
Syntax
firstUse cases
| Use case | Description | URL | |
|---|---|---|---|
| Get the cheapest item | Sort by price ascending and extract just the single cheapest record. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/posts|sort:id|first | |
| Top starred repo as object | Get the single most-starred repo as a plain object, not an array. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|rsort:stargazers_count|first|pick:name,stargazers_count,html_url | |
| First user in directory | Pull the first alphabetical user after sorting by name. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/users|sort:name|first|pick:name,email | |
| Extract first match | Filter to matching records then unwrap the single result. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/posts|filter:userId,eq,3|sort:id|first|pick:id,title |