'Is it possible to update data without affecting Indexes?

I'm using MongoDB(version 5.0), with somewhat large data and indexes.

Data Storage size is around 2.5TB and indexes(8 indexes) size is also sums up to 1TB. Since I'm pouring those data into a new mongodb and establishing new indexes, so it's taking proximately 1~2 weeks. (Estimated, still pouring)

But, with service updates, it's highly alike that new column will have to be added into documents. (or modify exist column) And, i think i will update them with bulkWrite and update.

Here come's the question, if the new column have nothing to do with indexes, will it be possible for update operation to work without accessing indexes?

For example, if old document, with indexes are set only on _id and memberNo

 { 
   _id: 's9023902', 
   memberNo: '20219210', 
   purchasedMurchantNo: 'M2937' 
} 

is update into below (column purchasedMurchantNo updated and returned added)

 { 
   _id: 's9023902', 
   memberNo: '20219210', 
   purchasedMurchantNo: 'NEW_FORMAT_NO_2937',
   isReturned: false
} 

My guess is that, it won't change the structure of index, and since mongodb will also know it by the index and query structure, so there will be no need to access index structure.

I'm asking, because with indexes, insert operations have been dramatically slowed down and cpu usage have also been dramatically increased, since this mongodb is not in service right now so high cpu usage rate is not an issue, but in the point when we update our mongodb, it will be in service, and it will be an issue.

Question in a sentense: In certain circumstances, can UpdateMany work in a fast speed, as if there is no index

Thank you in advance for brilliant answer given for not so brilliantly asked question.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source