Description
The json_merge function would retain the rightmost key when the leaf elements have the same key. However, in some cases, you may want to aggregate the two results e.g. adding, multiplying, etc. If we can pass a lambda as an argument inside json_merge, we need not write custom json functions for doing such aggregations.