>>> kl Collection(Database(Connection('localhost', 27017), 'blog'), 'kl') >>> for d in kl.find(): ... print(d) ... {'title': 'my first blog', '_id': ObjectId('52a95f90663e8e1f03a20cec'), 'date': 'Thu Dec 12 14:49:15 2013', 'content': '试试中文'} {'title': 'my 2nd blog', '_id': ObjectId('52a963e1663e8e1f03a20ced'), 'date': 'Thu Dec 12 15:20:45 2013', 'content': '第二篇博文'}
>>> kl.update({'title':'my first blog'},{'$SET':{'content':'第一篇博文'}})
>>> for k in kl.find(): ... print(k) ... {'title': 'my first blog', '_id': ObjectId('52a95f90663e8e1f03a20cec'), 'date': 'Thu Dec 12 14:49:15 2013', 'content': '试试中文'} {'title': 'my 2nd blog', '_id': ObjectId('52a963e1663e8e1f03a20ced'), 'date': 'Thu Dec 12 15:20:45 2013', 'content': '第二篇博文'}
试试这个。