New merge flag (n) to only merge in new fields (#1038)

This commit is contained in:
Mike Farah
2022-01-15 15:48:34 +11:00
parent ec8ef312ef
commit 8c94a96ee0
7 changed files with 74 additions and 13 deletions
@@ -10,9 +10,10 @@ Note that when merging objects, this operator returns the merged object (not the
### Merge Flags
You can control how objects are merged by using one or more of the following flags. Multiple flags can be used together, e.g. `.a *+? .b`. See examples below
- `+` to append arrays
- `?` to only merge existing fields
- `d` to deeply merge arrays
- `+` append arrays
- `d` deeply merge arrays
- `?` only merge _existing_ fields
- `n` only merge _new_ fields
### Merging files
Note the use of `eval-all` to ensure all documents are loaded into memory.