I have a dictionary of the structure like:
{
{'A':123,
'B':{"QW":456, "RE":897, "_id" = "IRET"}
},
{'C':123,
'D':{"DE":56, "YE":87, "_id" = "REWQ"}
},
{'E':123,
'F':{"RT":432, "MN":7, "_id" = "AWER"}
}
}
I need to search this dict for '_id' == "AWER" while returning
{'E':123,
'F':{"RT":432, "MN":7, "_id" = "AWER"}
}
What I have tried:
This is only for the first nest of the query.
lst = next(k,v for k,v in data[0].items() if v['E'] == '123')