There is problem with fetching data from chunks collection. taking too much time . Database size 70 gb . not able to rebuild index. version 5.0 . any solution?

It was working fine for previous versions but having an issue regarding fetching data in Mongo dB and showing error "Javascript execution interrupted "

Query: dB.getcollection(‘sanction.chunks’).reindex()

What I have tried:

Tried indexing, reinstalled it all over again, checked system settings and network proxy

Could you give some more explanation and info. For example why are you running this query, is there a reason you are trying to rebuild all the indexes? What is your MongoDB setup (standalone, replica, sharded), how many indexes do you have?

I’m not sure how many documents that you have but 70gb is pretty large and this command is very resource expensive, because it has to drop and rebuild all indexes on each document. I am assuming there is a timeout issue happening due to how long the query is taking to run.

I am using this query for having an issue to search the data.I am trying to execute this db.getCollection('Sanction.chunks').find({"files_id" : ObjectId("623bf46705b1e52ed8b99d9c")}) query but keeps on loading and not able to fetch neither a suitable result nor any sort of error.
I am using mongo db 5.0 community version. it was working fine for previous version 4.0 but as soon as I dumped the data and restored in latest version ,it stops working.it contains around 600000 (six hundred thousand) records in it.