【发布时间】:2015-01-04 16:36:49
【问题描述】:
通过查询 collection.find() 方法,以下 Json 来自 Mongodb。如何在 Python 中将此 Json 转换为 Dictionary?我想在我的字典中将 BMW 映射为键,将 Series 3 映射为值。
Python:
content = list(collection.find({"_id": "sample_abc"}, {"Car":1, "_id":0}))
print (content)
控制台:
[{'Car': [{'BMW': 'series 3'}, {'Audi': 'A4'}]}]
【问题讨论】:
-
您是否查看过例如
json?!
标签: python json mongodb dictionary