mongoengine 更新

mongoengine 更新

collection.update({‘userid’:int(float(item))},{‘$set’:{‘status’:1}},upsert=False,multi=True)

有兴趣可以研究一下update的四个参数:

第一个为匹配

第二个为条件(条件上可以大作文章),

第三个为没找到是否插入,

第四个为是否支持多操作



This entry was posted on 2018 年 03 月 23 日 and is filed under IT DOC. Written by: . You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.