0
我正在尝试使用CouchDB的Python包装来更新数据库。该文件按如下所示构建为嵌套字典。为什么CouchDb-python(或我)会混淆字符串和字典?
doc = { ...,
'RLSoo': {'RT_freq': 2, 'tweet': "They're going to play monopoly now.
This makes me feel like an excellent mother. #Sandy #NYC"},
'GiltCityNYC': {},
....}
我愿把大dicitionary的每个条目,例如RLSoo
到它自己的文件。但是,当我尝试下面的代码时,我收到一条错误消息。
for key in doc:
db.update(doc[key],all_or_nothing=True)
错误消息
TypeError: expected dict, got <type 'str'>
我不明白为什么CouchDB的将不接受字典。