Skip to content

Commit

Permalink
fix: year update
Browse files Browse the repository at this point in the history
연도가 다르나, 같은 지역 후보의 경우 업데이트되는 에러를 해결했습니다.
  • Loading branch information
happycastle114 committed Nov 29, 2023
1 parent 4bf5776 commit ee928ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions API/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def save_to_mongo(data: List[dict], sgTypecode: str, where: str) -> None:
if district_id:
main_collection.update_one(
{
"year": entry["year"],
"name": entry["name"],
"localId": district_id["localId"],
"metroId": district_id["metroId"],
Expand All @@ -64,6 +65,7 @@ def save_to_mongo(data: List[dict], sgTypecode: str, where: str) -> None:
for entry in data:
main_collection.update_one(
{
"year": entry["year"],
"name": entry["name"],
"localId": 0,
"metroId": 0,
Expand Down

0 comments on commit ee928ea

Please sign in to comment.