avian2 / jsonmerge

Merge a series of JSON documents.
MIT License
214 stars 25 forks source link

Feature request: Merge multiple versions #54

Open hardiksondagar opened 3 years ago

hardiksondagar commented 3 years ago

The current strategies work well to merge two versions. In some use cases, there is a need to merge multiple versions at the same time to get the final version.

For example, merging a startup's funding amount from different media sources.

version = v_techcrunch
{
    "name": "Coinbase",
    "funding": "$200M"
}

version = v_crunchbase
{
    "name": "Coinbase",
    "funding": "$80M"
}

version = v_angellist
{
    "name": "Coinbase",
    "funding": "$120M"
}

final_version
{
    "name": "Coinbase",
    "funding": "$200M" <--- from v_techcrunch version
}

Here, it needs to be merged based on how recent and accurate data each media sources have. Like TechCrunch will have the latest data of startup's funding compare to Crunchbase and AngelList.

Some ideas of additional merge strategy

I am taking inspiration from all contributes of this repo who did great work, to make something similar to that supports the merger of multiple versions.

Cheers