1234567891011121314151617181920212223 |
- from pymongo import MongoClient
- import setting
- import utils.tools as tool
- from log import logger
- if __name__ == '__main__':
- to_mongo = MongoClient(setting.MONGO_IP, setting.MONGO_PORT)
- account_coll = to_mongo[setting.MONGO_DB]['ybw_info']
- # 重置 账号信息
- with account_coll.find() as cursor:
- for item in cursor:
- update_date = tool.get_current_date()
- account_coll.update_one(
- {"_id": item["_id"]},
- {"$set": {
- "count": 0,
- "login_times": 0,
- "update_time": update_date
- }}
- )
- logger.info(f" {item['account']} 已更新 < {update_date} >")
|