Update Large Collection with same value for all documents

I am Using Python 3+ and trying to update a large collection (70K documents)
All documents in the collection should be updated for ONE FIELD with the same value

I tried these Options, and it takes very long time. had to abort in between.
doc=mycollection.find({},{“mcs”:"{}"},sort=[("_id", 1)])
for data in doc:
Option1: collection.update_many({},{"$set":{“mcs”:json_data}})
Option2: requests_list = [UpdateMany({},{"$set":{“mcs”:json_data}},upsert = False)]
Option3: requests_list = [UpdateOne({},{"$set": {“mcs”: json_data}},upsert=False)] ( this will update
only one record)
collection.bulk_write(requests_list,ordered = False)

Any suggestions?

Hi @Girish_V and welcome to the community!!

It would be very helpful if you could help me in understanding the following to understand in more better way:

  1. Is the a time estimate on how long the update takes for all the options mentioned ?

  2. Can you share an example document and the desired output after the update is made for the documents.

  3. The MongoDB version you are using.

  1. Does the field “mcs” is there for all the documents in the collection?

  2. Do you see a similar delay for update while performing the update operation using mongosh?

Let us know the following details for better understanding .

Best Regards
Aasawari