Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-3375 test that v0 key generation used for v0 indexes

  • Loading branch information...
commit 20b7e94cba2fc8d1c7a63f7b7c4fb028a7456546 1 parent f10ca8d
@astaple astaple authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 jstests/indexw.js
View
14 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:[]} ) );
Please sign in to comment.
Something went wrong with that request. Please try again.