Basically this is about how $maxKey displayed compared to how you pass it to the shell to use it in a command. The simplest thing is to show a working example, so here is my original layout of my test collection ( foo.bar ):
foo.bar shard key: { "_id" : "hashed" } chunks: shard0000 3 { "_id" : { "$minKey" : 1 } } -->> { "_id" : NumberLong("-4097713469691957209") } on : shard0000 Timestamp(1, 3) { "_id" : NumberLong("-4097713469691957209") } -->> { "_id" : NumberLong("1468066378930898747") } on : shard0000 Timestamp(1, 4) { "_id" : NumberLong("1468066378930898747") } -->> { "_id" : { "$maxKey" : 1 } } on : shard0000 Timestamp(1, 2)
To break this last fragment, do the following:
db.adminCommand( { split: "foo.bar", bounds: [{_id: NumberLong("1468066378930898747")}, {_id: MaxKey}] } ) { "ok" : 1 }
Now, to prove this, the layout looks like this:
foo.bar shard key: { "_id" : "hashed" } chunks: shard0000 4 { "_id" : { "$minKey" : 1 } } -->> { "_id" : NumberLong("-4097713469691957209") } on : shard0000 Timestamp(1, 3) { "_id" : NumberLong("-4097713469691957209") } -->> { "_id" : NumberLong("1468066378930898747") } on : shard0000 Timestamp(1, 4) { "_id" : NumberLong("1468066378930898747") } -->> { "_id" : NumberLong("5350365356528563634") } on : shard0000 Timestamp(1, 5) { "_id" : NumberLong("5350365356528563634") } -->> { "_id" : { "$maxKey" : 1 } } on : shard0000 Timestamp(1, 6)
source share