Sample input json: {"array1":["value","value","value"],"object2":"value2","object3":"value3","object4":"value4","object6":"value6"} {"array1":["value","value"],"object2":"value2","object3":"value3","object4":"value4","object5":"value5","object6":"value6","object7":"value7"} {"object2":"value2","object3":"value3","object5":"value5","object6":"value6","object7":"value7","object8":"value8","object9":"value9"} {"array1":["value"],"object2":"value2","object3":"value3","object8":"value8","object9":"value9"} notes for input json: 1.array can have multiple data inside 2.values can be of any data type 3.if there's no data on array, it will not be on the input json 3.input json can have up to 1M of rows Sample output json {"update": {"_id": , "_index": "index_name"}} {"doc": {"array1":["value","value","value"],"object2":"value2","object3":"value3","object4":"value4","object6":"value6"}, "doc_as_upsert" : true} {"update": {"_id": , "_index": "index_name"}} {"doc": {"array1":["value","value"],"object2":"value2","object3":"value3","object4":"value4","object5":"value5","object6":"value6","object7":"value7"}, "doc_as_upsert" : true} {"update": {"_id": , "_index": "index_name"}} {"doc": {"object2":"value2","object3":"value3","object5":"value5","object6":"value6","object7":"value7","object8":"value8","object9":"value9"}, "doc_as_upsert" : true} {"update": {"_id": , "_index": "index_name"}} {"doc": {"array1":["value"],"object2":"value2","object3":"value3","object8":"value8","object9":"value9"}, "doc_as_upsert" : true} notes for output json 1. each input json row should have 2 output json rows (update function and doc) 2. doc object should contain the whole row of the input json