I have a large number of key dictionaries inside a dictionary named data. I would like to iterate over the collection of dicts to find the bus of type 12, which must be only one in the collection. I came up with the following piece of lines, but is there any improvement for this to save time?
for i = 1:length(data["bus"])
if data["bus"]["$(i)"]["type"] == 12
global new_key = data["bus"]["$(i)"]["key"];
end
end