我的收藏结构是:
col1 = {'class':'12', 'roll':[1, 2, 3, 4]}
现在,我想更新
集合col1
到
col1 = {'class':'12', 'roll':[1, 2, 3, 4, 5]}
我在这里添加了另一个卷号,How to update this collection in pymongo.
最佳答案
db.col1.update( { class : 12}, { $push : { roll : 5 } } )
关于python - 如何更新 mongodb 集合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3976070/