Suppose I have a List<map> that looks like this:
‘Books’:[
‘B1’{
‘id’: ’1234’,
‘bookName’: ’book1’
},
‘B2’{
‘id’: ’4567’,
‘bookName’: ’book2’
},
‘B3’{
‘id’: ’1234’,
‘bookName’: ’book3’
},
‘B4’{
‘id’: ’8912’,
‘bookName’: ’book4’
},
…
];
I’m trying to return the entire book without duplications in Id.
The expected result should be like this:
‘B1’{
‘id’: ’1234’,
‘bookName’: ’book1’
},
‘B2’{
‘id’: ’4567’,
‘bookName’: ’book2’
},
‘B4’{
‘id’: ’8912’,
‘bookName’: ’book4’
},