An introduction to the lightweight and flexible command-line JSON processor jq

preview_player
Показать описание
By popular request, we wrap up this year with an introduction to jq, which we've used already with the BTP Setup Automator, the btp CLI and more. If you haven't explored jq and thought about adding it to your toolbox, now would be a good time to do so!

Topics:
jq, JSON, ijq, jqplay, jqterm, SAP BTP, metadata, filters, JavaScript, btp CLI

Links:

Chapters:

00:00 Welcome and introduction
05:50 Using the BTP Setup Automator container image for easy access to all the tools incl. jq, ijq and more
08:25 Taking a look at some of the jq command line options (via jq --help)
11:50 Starting with jqterm for our session
14:00 Considering valid JSON values
17:00 Thinking about streams of JSON values
18:15 Looking what slurp (-s) does for us
21:10 Considering raw input (-R) for non-JSON values
22:55 Looking briefly at the jq language server
23:50 Exploring some more realistic JSON, obtained via the btp CLI
28:00 Understanding what data the filter is looking at
31:49 Shorthand vs longhand filter expression
32:50 Capturing data via the variable operator, and how data is (or isn't) consumed
34:55 Using 'map', passing a filter expression, and how it's similar to JS
36:50 Asking for the length of an object gives us the number of properties
37:50 Understanding how jq passed data to multiple consuming filters
39:27 Producing objects using convenient property shorthand features
40:55 Filtering data out with 'select' plus a predicate expression
44:30 Sorting with 'sort_by'
45:20 Producing a flat list of values for further consumption or file storage, with raw output (-r)
47:40 A brief digression to consider the importance of the array iterator (.[]) and how it produces multiple values downstream
52:00 Looking at what the @tsv and @csv formatters will do for us
53:30 Transforming structure with 'group_by' and taking care to understand the new structure produced
56:30 Another digression on 'first' being just syntactic sugar for .[0]
59:45 Producing a list of data centers providers, with a count
59:58 A brief intro to how 'add' can add objects together
Рекомендации по теме
Комментарии
Автор

Thanks D.J for sharing us this cool stuff as always. I missed this live session but still able to enjoy it later.

wiseskeshom