Smarter aggregation of jsons by keys for string values