Combine several fields using ruby/merge/aggregate

Can you provide examples that are valid JSON for both the input and result? It's really unclear what you want.