mongodb
self.mongo_db[spider.name].update({'_id': item['pop_id']}, {'$set': item},upsert=True)
mysql
sql = f"replace into store_comment(_id,time,type,uid,name,content,star,additon,time_stamp) values({values});"
self.mongo_db[spider.name].update({'_id': item['pop_id']}, {'$set': item},upsert=True)
sql = f"replace into store_comment(_id,time,type,uid,name,content,star,additon,time_stamp) values({values});"
本文标题:mongodb和mysql以更新的方式插入
本文链接:https://www.haomeiwen.com/subject/rjwmiltx.html
网友评论