mongodb更新插入语法

it2025-10-21  9

import requests, pymongo import json client = pymongo.MongoClient('127.0.0.1', 27017) db = client.zhongguangda collection = db.douyin_fans collection.update({'open_id': ''}, {'$set': {'avatar': 'name', 'city':'', 'country':'', 'gender':'', 'nickname': '', 'province':'', 'union_id':'' }}, upsert=True)
最新回复(0)