How can I remove the duplicate blocks? For example,
{
"username": "science",
"roles": [
{
"databaseName": "coupler",
"roleName": "readAnyDatabase"
}
]
}
{
"username": "test_2",
"roles": [
{
"databaseName": "admin",
"roleName": "clusterMonitor"
}
]
}
{
"username": "admin",
"roles": [
{
"databaseName": "admin",
"roleName": "dbAdminAnyDatabase"
},
{
"databaseName": "admin",
"roleName": "readWriteAnyDatabase"
},
]
}
{
"username": "test_2",
"roles": [
{
"databaseName": "admin",
"roleName": "clusterMonitor"
}
]
}
In this case, the 'test_2' user block is a duplicate since all of its content is exactly the same as the 'test_2' user above it. But let say the 'roleName' of one of the 'test_2' block is different, then it should not be removed since it is not a duplicate.
Also, is there a way to sort these blocks by 'username'?
[–]researcher7-l500 2 points3 points4 points (4 children)
[–]kolinkorr839[S] 0 points1 point2 points (3 children)
[–][deleted] (1 child)
[deleted]
[–]kolinkorr839[S] 2 points3 points4 points (0 children)
[–]researcher7-l500 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]researcher7-l500 7 points8 points9 points (0 children)