Skip to content

Commit

Permalink
drop_column
Browse files Browse the repository at this point in the history
  • Loading branch information
KTAP8 committed Dec 10, 2024
1 parent 46e1090 commit e1cf27e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion add_file_to_mongo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def update_author(collection, new_field_name):

arxiv = db['arxivScraped']
arxiv2 = db['arxivScrapedCopy']
papers = db['papers']
# update_author(arxiv, "authors")

# arxiv.update_many({}, {"$unset": {"authors": ""}})
Expand Down Expand Up @@ -136,4 +137,12 @@ def update_ref(collection, new_field_name, original):
print("setting " + str(document['_id']))


update_ref(arxiv, "reference", arxiv2)
#update_ref(arxiv, "reference", arxiv2)

def drop_column(collection, column):
collection.update_many({}, {"$unset": {column: ""}})
print(f"Column '{column}' has been dropped from the database!")

#drop_column(arxiv2, 'Predictions_area')
#drop_column(arxiv, 'Predictions_area')
#drop_column(papers, 'Predictions_area')

0 comments on commit e1cf27e

Please sign in to comment.