Coverage for migrations/2023_11_06_000001_drop_contests.py: 0%

10 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2024-11-05 04:22 +0000

1import pymongo 

2 

3from . import MONGO_HOST, DATABASE 

4 

5 

6def main(): 

7 client = pymongo.MongoClient(MONGO_HOST) 

8 db = client[DATABASE] 

9 collection = db['course'] 

10 collection.update_many({}, {'$unset': {'contests': 1}}) 

11 collection = db['problem'] 

12 collection.update_many({}, {'$unset': {'contests': 1}}) 

13 

14 

15main()