Skip to content

Commit

Permalink
Fix migration by using aggregation pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Dec 1, 2023
1 parent f367616 commit f3d05c8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ async def migrate_up(self):
async for org in mdb_orgs.find({"monthlyExecSeconds": None}):
oid = org["_id"]
try:
await mdb_orgs.find_one_and_update(
await mdb_orgs.update_one(
{"_id": oid},
{"$set": {"monthlyExecSeconds": "$crawlExecSeconds"}},
[{"$set": {"monthlyExecSeconds": "$crawlExecSeconds"}}],
)
# pylint: disable=broad-exception-caught
except Exception as err:
Expand Down

0 comments on commit f3d05c8

Please sign in to comment.