0

以下のような JSON オブジェクトがあります。

[
        {
            "companyAlias": "ABC",
            "refNo": "ABC0001",
            "Date": "12/09/2018",            
            "Sub": "ABC Subj" ...
        },
        {
            "companyAlias": "ABC",
            "refNo": "ABC0002",
            "Date": "12/09/2018", 
            "Sub": "ABC Subj1" ...
        },
        {
            "companyAlias": "ABC",
            "refNo": "ABC0003",
            "Date": "12/09/2018", 
            "Sub": "ABC Subj3"...
        },
        {
            "companyAlias": "BCD",
            "refNo": "BCD0001",
            "Date": "14/09/2018", 
            "Sub": "BCD Subj"...
        },
       {
            "companyAlias": "BCD",
            "refNo": "BCD0002",
            "Date": "14/09/2018", 
            "Sub": "BCD Subj2"...
        },...
]

簡単に処理できるように、以下の形式に変換したいと思います (基本的には、companyAlias と Date でグループ化します)。

upComingArray":

[
        {
            "companyAlias": "ABC",            
            "Date": "12/09/2018" 
             [ {   
                "refNo": "ABC0001"
               "Sub": "ABC Subj"
               },           
               {
                "refNo": "ABC0002",            
                "Sub": "ABC Subj1"
               },
               {            
               "refNo": "ABC0003",            
                "Sub": "ABC Subj3"
            }]
         },
        {
            "companyAlias": "BCD",
            "Date": "14/09/2018"
             [
             {
             "refNo": "BCD0001",
             "Sub": "BCD Subj"
            },
           {

            "refNo": "BCD0002",            
            "Sub": "BCD Subj2"
        }]
},...
]

分かる方いましたら教えてください...

前もって感謝します

4

2 に答える 2