Initially, I've this array:
[{
"vendorid": 1,
"vendorname": "Vendor1",
"maxfilelimit": 2,
"uploadfilename": "Voice1.xlsx"
},
{
"vendorid": 1,
"vendorname": "Vendor1",
"maxfilelimit": 2,
"uploadfilename": "Ven1_Voice.xlsx"
},
{
"vendorid": 2,
"vendorname": "Vendor2",
"maxfilelimit": 2,
"uploadfilename": "Voice2.xlsx"
},
{
"vendorid": 2,
"vendorname": "Vendor2",
"maxfilelimit": 2,
"uploadfilename": "Ven2_Voice.xlsx"
}]
I want the file names in an array with no repetition of records. So, I expect the output similar to following:
[{
"vendorid": 1,
"vendorname": "Vendor1",
"maxfilelimit": 2,
"uploadfilename": ["Voice1.xlsx", "Ven1_Voice.xlsx"]
}, {
"vendorid": 2,
"vendorname": "Vendor2",
"maxfilelimit": 2,
"uploadfilename": ["Voice2.xlsx", "Ven2_Voice.xlsx"]
}]
I found some solutions like d3.js, alaSQL but not getting output as expected
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…