I am currently parsing two JSON files using Python 2.7. The goal is to check each JSON object in file1 to each JSON object on file2 and compare them using their 'name' keys. If there is a match then overwrite obj2 with obj1 data. My psuedocode (below) right now would run in O(n^4) time. That is way too slow so if anyone can point out a faster method I'd appreciate it.
for obj1 in file1:
for key1, value1 in obj1.iteritems():
if key1 == 'name':
for obj2 in file2:
for key2, value2 in obj2.iteritems():
if key2 == 'name':
if value1 == value2:
overwrite obj2 using obj1 data