InterviewSolution
| 1. |
What are different index options MongoDB provides? |
|
Answer» Chunk split operations are carried out automatically by the system when any insert operation causes chunk to exceed the maximum chunk size. Balancer then migrates recently split chunks to new shards. But in some cases we may want to pre-split the chunks manually:
To split the chunks manually we can use the split command with helper sh.splitFind() and sh.splitAt(). Example: To split the chunk of employee collection for employee id field at a value of 713626 below command should be used. sh.splitAt( "test.people", { "employeid": "713626" } )We should be careful while pre-splitting chunks as sometimes it can lead to a collection with different sized chunks. |
|