mongo
|
MongoDB shell version: 2.0.4
|
connecting to: test
|
test[14:7:40]> sh.shardCollection('test.bar', {i:1})
|
test[14:7:53]> db.bar.insert({i : [1, 2]})
|
tried to insert object with no valid shard key for { i: 1.0 } : { _id: ObjectId('5005aa08ba72dc4f64314847'), i: [ 1.0, 2.0 ] }
|
test[14:8:9]> sh.shardCollection('test.baz', {_id:1})
|
test[14:8:25]> db.baz.insert({_id : [1, 2]})
|
test[14:8:34]> db.baz.find()
|
{ "_id" : ObjectId("5005aa223af26b5b5e49a1be"), "_id" : ObjectId("5005aa223af26b5b5e49a1be") }
|