Skip to content

Commit

Permalink
SERVER-3375 test that v0 key generation used for v0 indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
astaple committed Jul 31, 2011
1 parent f10ca8d commit 20b7e94
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions jstests/indexw.js
@@ -0,0 +1,14 @@
// Check that v0 keys are generated for v0 indexes SERVER-3375

t = db.jstests_indexw;
t.drop();

t.save( {a:[]} );
assert.eq( 1, t.count( {a:[]} ) );
t.ensureIndex( {a:1} );
assert.eq( 1, t.count( {a:[]} ) );
t.dropIndexes();

// The count result is incorrect - just checking here that v0 key generation is used.
t.ensureIndex( {a:1}, {v:0} );
assert.eq( 0, t.count( {a:[]} ) );

0 comments on commit 20b7e94

Please sign in to comment.