mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-3005 test
This commit is contained in:
parent
18cad05fea
commit
4916ede8e5
23
jstests/indexs.js
Normal file
23
jstests/indexs.js
Normal file
@ -0,0 +1,23 @@
|
||||
// Test index key generation issue with parent and nested fields in same index and array containing subobject SERVER-3005.
|
||||
|
||||
t = db.jstests_indexs;
|
||||
|
||||
t.drop();
|
||||
t.ensureIndex( {a:1} );
|
||||
t.save( { a: [ { b: 3 } ] } );
|
||||
assert.eq( 1, t.count( { a:{ b:3 } } ) );
|
||||
|
||||
t.drop();
|
||||
t.ensureIndex( {a:1,'a.b':1} );
|
||||
t.save( { a: { b: 3 } } );
|
||||
assert.eq( 1, t.count( { a:{ b:3 } } ) );
|
||||
ib = t.find( { a:{ b:3 } } ).explain().indexBounds;
|
||||
|
||||
t.drop();
|
||||
t.ensureIndex( {a:1,'a.b':1} );
|
||||
t.save( { a: [ { b: 3 } ] } );
|
||||
assert.eq( ib, t.find( { a:{ b:3 } } ).explain().indexBounds );
|
||||
if ( 0 ) { // SERVER-3005
|
||||
assert.eq( 1, t.find( { a:{ b:3 } } ).explain().nscanned );
|
||||
assert.eq( 1, t.count( { a:{ b:3 } } ) );
|
||||
}
|
Loading…
Reference in New Issue
Block a user