What it does
Add the files, in the order they should be merged, and choose how: the files are read in that order and put in one array, which is what the filter is given, the way jq -s does it. In the filter . is that array and $files is the array of the files' names. The result updates as you change the list or the filter.
Ready-made filters
- Append arrays:
add. Joins arrays end to end. Objects work too: their keys are combined and a later file wins a clash. - Append, sorted and de-duplicated:
add | unique. jq's unique also sorts. - Deep-merge objects:
reduce .[] as $file ({}; . * $file). Key by key, all the way down. - Bundle by file name: each file whole, labelled with its name.
A filter of your own
The filter is ordinary jq, so anything it can do is a merge. Some that come up:
add | group_by(.id) | map(add): records with the same id are combined, later files win.add | unique_by(.id): one record per id, the first seen.[range(0; length) as $i | .[$i][] | . + {from: $files[$i]}]: tag every record with its file.map(select(type == "array")) | add: skip the files that are not arrays.
A filter that gives several outputs gives them as one array.
Exact, and in your tab
Every digit of a number is kept, and the order of an object's keys. The files are read and merged by the same Rust engine as the desktop app, compiled to WebAssembly: nothing is uploaded. This page takes up to 48 MB in all, 10 MB a file; the desktop app merges up to 128 MB at a time. To query the result use Open in Query, to compare it with another document use Diff, to check it Validate.