I have multiple JSON records like
{
"Stat": "DEN",
"Change": [{
"From": "",
"To": "DEN",
"changeTimestamp": "20200325000000"
},
{
"From": "",
"To": "DEN",
"changeTimestamp": "20200325000000"
},
],
"Date": 20200401
}
since Changes array has duplicates need to eliminate them it should be like
{
"Stat": "DEN",
"Change": [{
"From": "",
"To": "DEN",
"changeTimestamp": "20200325000000"
}
],
"Date": 20200401
}
since it is an array am unable to use list, I have a code like
doc['Changes'] = list(set(doc['Changes'])) if doc['Changes'] else []
It is working for items that are on the list but I came to know its not a list it's an array it won't work, can I get help for this, please