Select Multiple Fields
The GitHub issues API has a lot of details I don’t care about. I want to select multiple fields from the returned JSON document and leave the rest behind.
The easiest way to do this is using , to specify multiple filters:
But this is returning the results of one selection after the other. To change the ordering, I can factor out the array selector:
This refactoring uses a pipe (|), which I’ll talk about shortly, and runs my object selectors (.title and .number) on each array element.
If you wrap the query in the array constructor you get this:
But this still isn’t the JSON document I need. To get these values into a proper JSON object, I need an object constructor.