2
我有这样插入项目的MongoDB文档中
{ "_id" : "decfed9a04b997d", "pushed_list" : [ ] }
的文件,我想更新/被存储在一个Python列表
lis1 =
[
{
item : 'item1',
desc : 'desc_item1'
},
{
item : 'item2',
desc : 'desc_item2'
},
{ ........................
}
]
我这些子项插入“pushed_list”试过这个
db.monitor.update({'_id' : 'dbjkdd'}, { '$push':{'pushed_list': {'$each':{lis1}}}})
它给了我一个错误。
Traceback (most recent call last):
File "monitor.py", line 13, in <module>
db.monitor.update({'_id' : 'dbjfdd'}, { '$push':{'pushed_list': {'$each':{lis1}}}})
TypeError: unhashable type: 'list'
的NoSQL数据块只是简单SOOOO – Sam