Skip to content

Instantly share code, notes, and snippets.

View namannigam's full-sized avatar
🎯
Focusing

Naman Nigam namannigam

🎯
Focusing
View GitHub Profile
//https://stackoverflow.com/questions/67570361/how-to-identify-duplicate-records-in-a-list
Map<Boolean, List<MyVo>> partitionBasedOnRegistered = dataList.stream()
.collect(Collectors.partitioningBy(MyVo::isRegistered));
List<MyVo> unregisteredBusinesses = partitionBasedOnRegistered.get(Boolean.FALSE); // here
List<MyVo> registeredBusinesses = partitionBasedOnRegistered.get(Boolean.TRUE);
Map<String, List<MyVo>> groupByRegistrationNumber = registeredBusinesses.stream()
.collect(Collectors.groupingBy(MyVo::registrationNumber));
{
"queryPlanner": {
"plannerVersion": 1,
"namespace": "mongo_experiments.product_snapshot_composite_index",
"indexFilterSet": false,
"parsedQuery": {
"uIdHash": {
"$eq": "2lgys2yxouhug5xj3ms45mluxw5hsweu"
}
},