summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-03-01 13:20:54 -0500
committerEliot Horowitz <eliot@10gen.com>2011-03-01 13:21:26 -0500
commit13608bb28320625c31c49f2cae9489874c4f295b (patch)
tree367e89e8796d4ec12dd43112696f02042c2a39e5 /jstests
parent83282b72fab32cabeb160ec03c56d63f297b905e (diff)
downloadmongo-13608bb28320625c31c49f2cae9489874c4f295b.tar.gz
null is ok in shard key, blank is not SERVER-2648
Diffstat (limited to 'jstests')
-rw-r--r--jstests/check_shard_index.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/check_shard_index.js b/jstests/check_shard_index.js
index af8a115836e..a5a1fc14c47 100644
--- a/jstests/check_shard_index.js
+++ b/jstests/check_shard_index.js
@@ -32,9 +32,14 @@ f.ensureIndex( { x: 1 , y: 1 } );
assert.eq( 0 , f.count() , "2. initial count should be zero" );
f.save( { x: 1 , y : 1 } );
+f.save( { x: null , y : 1 } );
+
+res = db.runCommand( { checkShardingIndex: "test.jstests_shardingindex" , keyPattern: {x:1, y:1} , force: true });
+assert.eq( true , res.ok , "2a " + tojson(res) );
+
f.save( { y: 2 } );
-assert.eq( 2 , f.count() , "2. count after initial insert should be 2" );
+assert.eq( 3 , f.count() , "2. count after initial insert should be 3" );
res = db.runCommand( { checkShardingIndex: "test.jstests_shardingindex" , keyPattern: {x:1, y:1} , force: true });
-assert.eq( false , res.ok , "2a" );
+assert.eq( false , res.ok , "2b " + tojson(res) );
print("PASSED");