Complete the code to list all chunks in a sharded collection.
db.getSiblingDB('config').chunks.find({ 'ns': [1] })
The ns field specifies the namespace (database.collection) for the chunks. You must provide the full namespace string.
Complete the command to enable the balancer in MongoDB.
sh.setBalancerState([1])To enable the balancer, you must pass true to sh.setBalancerState().
Fix the error in the command to get the current balancer status.
sh.[1]()The correct method to get the balancer state is sh.getBalancerState().
Fill both blanks to create a query that finds chunks with a max key greater than 100.
db.getSiblingDB('config').chunks.find({ 'max.[1]': { [2]: 100 } })
The shard key field is used to check the max value. The operator $gt means 'greater than'.
Fill all four blanks to create a command that moves a chunk to a specific shard.
sh.moveChunk('[1]', { '[2]': [3] }, '[4]')
The first argument is the namespace, the second is the shard key value to identify the chunk, and the third is the destination shard name.