summaryrefslogtreecommitdiff
path: root/jstests/sharding/addshard1.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/addshard1.js')
-rw-r--r--jstests/sharding/addshard1.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/jstests/sharding/addshard1.js b/jstests/sharding/addshard1.js
index f28feed..0ca6a83 100644
--- a/jstests/sharding/addshard1.js
+++ b/jstests/sharding/addshard1.js
@@ -44,7 +44,7 @@ assert.eq( s.normalize( s.config.databases.findOne( { _id : "testDB" } ).primary
assert.eq( numObjs , sdb1.foo.count() , "wrong count after moving datbase that existed before addshard" );
// make sure we can shard the original collections
-sdb1.foo.ensureIndex( { a : 1 } ) // can't shard populated collection without an index
+sdb1.foo.ensureIndex( { a : 1 }, { unique : true } ) // can't shard populated collection without an index
s.adminCommand( { enablesharding : "testDB" } );
s.adminCommand( { shardcollection : "testDB.foo" , key: { a : 1 } } );
s.adminCommand( { split : "testDB.foo", middle: { a : Math.floor(numObjs/2) } } );