How do I remove the entire object if it has a key that contains a string?
In this example the program should remove the entirety of player1 and player2 because I want to remove all players with the string "rare" in the key rarity.
{
"player": {
"rating": "99",
"rarity": "super_rare"
},
"player2": {
"rating": "87",
"rarity": "rare"
},
"player3": {
"rating": "89",
"rarity": "common"
}
}