summaryrefslogtreecommitdiff
path: root/jstests/sharding/features2.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-11-19 21:42:46 -0500
committerEliot Horowitz <eliot@10gen.com>2009-11-19 21:42:46 -0500
commitdaaa53c4c52727a8e47e14da060ad436191c4555 (patch)
tree8d9083e31dfb6ae1e50f08a484c3588c983f3e33 /jstests/sharding/features2.js
parent1c136572d66a7fc103026cbac7b5b053200e940c (diff)
downloadmongo-daaa53c4c52727a8e47e14da060ad436191c4555.tar.gz
fix sharding on _id when _id is missing SHARDING-55
Diffstat (limited to 'jstests/sharding/features2.js')
-rw-r--r--jstests/sharding/features2.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/jstests/sharding/features2.js b/jstests/sharding/features2.js
index a16f5887aef..8beadac673c 100644
--- a/jstests/sharding/features2.js
+++ b/jstests/sharding/features2.js
@@ -49,6 +49,21 @@ assert.eq( 3 , db.foo.count() , "D6" );
db.foo.remove( {} );
assert.eq( 0 , db.foo.count() , "D7" );
+// --- _id key ---
+
+db.foo2.save( { _id : new ObjectId() } );
+db.foo2.save( { _id : new ObjectId() } );
+db.foo2.save( { _id : new ObjectId() } );
+
+assert.eq( 1 , s.onNumShards( "foo2" ) , "F1" );
+
+s.adminCommand( { shardcollection : "test.foo2" , key : { _id : 1 } } );
+
+assert.eq( 3 , db.foo2.count() , "F2" )
+db.foo2.insert( {} );
+assert.eq( 4 , db.foo2.count() , "F3" )
+
+
// --- map/reduce
db.mr.save( { x : 1 , tags : [ "a" , "b" ] } );