以下Json是通过查询collection.find()方法从Mongodb获得的。如何将此Json转换为Python中的Dictionary?我想将BMW作为钥匙和Series 3作为我的字典中的价值。将Json转换为Python中的字典
的Python:
content = list(collection.find({"_id": "sample_abc"}, {"Car":1, "_id":0}))
print (content)
控制台:
[{'Car': [{'BMW': 'series 3'}, {'Audi': 'A4'}]}]
你进去看了看,例如,[ 'json'](HTTP S://docs.python.org/2/library/json.html)? – jonrsharpe