123456789101112131415161718192021 |
- from pymongo import MongoClient
- client = MongoClient('mongodb://172.20.45.129:27002/')
- db = client['data_quality']
- collection = db['bidding_202505']
- # 删除 comeintime 在 [1747152000, 1747238400] 范围内的文档
- # result = collection.delete_many({
- # "comeintime": {
- # "$gte": 1747152000, # 大于等于 from
- # "$lte": 1747238400 # 小于等于 to
- # }
- # })
- count = collection.count_documents({
- "comeintime": {
- "$gte": 1747152000,
- "$lte": 1747238400
- }
- })
- print(f"符合条件的数据量: {count}")
- # print(f"删除了 {result.deleted_count} 条文档")
|