I have a large json file that contains thousands of documents:
[
    {
        "_id": "document1",
        "fields": [ ... ]
    },
    {
        "_id": "document2",
        "fields": [ ... ]
    },
    ...
]
I'd like to split this json file so that each json file contains a single document, and name them accordingly:
document1.json, document2.json, ...
For example, document1.json will contain:
{
    "_id": "document1",
    "fields": [ ... ]
}
I have no knowledge of jq API, and I'm struggling to find an answer (I've find a similar question, but slightly different :( )
 
     
     
     
    