Generally, no special operation is required to delete it. The Btree used by MongoDB is also self-balancing and does not need to be rebuilt. Except for a bug SERVER-21063 in 3.0.7 and earlier versions that will affect the balance of the btree, I have not heard of anything special that needs attention. This situation of increasing from 6G to 9G has never been heard of. You can see if the same is true for slave nodes. If possible, for verification purposes, delete the index on a slave node and recreate it to see if the size is different. Edit: You can try compact to see if it works before trying it. Pay attention to the impact on the instance. It is best to separate a secondary and test it separately.
This is explained in the document. When deleting data, the index will not be deleted. Even if you delete the entire collection, the index will not be deleted. So at this time, I suggest you rebuild the index.
Generally, no special operation is required to delete it. The Btree used by MongoDB is also self-balancing and does not need to be rebuilt. Except for a bug SERVER-21063 in 3.0.7 and earlier versions that will affect the balance of the btree, I have not heard of anything special that needs attention.
This situation of increasing from 6G to 9G has never been heard of. You can see if the same is true for slave nodes. If possible, for verification purposes, delete the index on a slave node and recreate it to see if the size is different.
Edit: You can try compact to see if it works before trying it. Pay attention to the impact on the instance. It is best to separate a secondary and test it separately.
This is explained in the document. When deleting data, the index will not be deleted. Even if you delete the entire collection, the index will not be deleted. So at this time, I suggest you rebuild the index.