The -n flag runs jq with no input, so the filter alone builds the output from scratch. Here an object literal computes sum as 100 plus 200, printing a JSON object with the value 300. This mode is handy for generating JSON payloads in scripts. Arithmetic, string concatenation, and functions all work inside the braces.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.