Run the command below after switch database. use test; db.collname.find( { }, { _id: 1, _id: 0 } ).hint( { _id: 1 } ).explain(true) “chunkSkips” : 0, check the chunkskips row. If its greater than 0 that means there are some orphan records on mongodb. —— Clear Orphan var dbName: Continue Reading
mongodb
How To Merge Chunks On MongoDB
There is a script that for merge chunks on mongodb use config // dbName: Set this to the database name// collection: Set this to the collection you want to merge chunks in// keyPattern: Set this to the key pattern, ie { “_id” : “hashed” }// sleepValue: How long to sleep Continue Reading
MongoDB Enable Sharding
Enable Sharding In order to shard a collection in mongodb, you need to set up a structure in accordance with the following criterias. Note: There is no rollback sharding process before mongodb version 5.0. The sharding key should be based on an index consisting of the commonly used query filter Continue Reading