There is such a problem, I can not create nested JSON, there are two nested for'a that should create JSON format,
{ index1 : {key1: val1, key2: val2}, index2 : {key1: val1, key2: val2} } The first pass generates a name for index, the second pass creates key and val values, how to create JSON correctly from this.