0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

add test for expiration of indexed or cursor referenced objects in capped collection

This commit is contained in:
Aaron 2009-05-18 13:59:22 -04:00
parent e57cb387c4
commit 9602cce53b
2 changed files with 24 additions and 0 deletions

22
jstests/capped4.js Normal file
View File

@ -0,0 +1,22 @@
t = db.jstests_capped4;
t.drop();
db.createCollection( "jstests_capped4", {size:1000,capped:true} );
t.ensureIndex( { i: 1 } );
for( i = 0; i < 20; ++i ) {
t.save( { i : i } );
}
c = t.find().sort( { $natural: -1 } ).limit( 2 );
c.next();
c.next();
d = t.find().sort( { i: -1 } ).limit( 2 );
d.next();
d.next();
for( i = 20; i < 40; ++i ) {
t.save( { i : i } );
}
assert( !t.findOne( { i : 19 } ) );
assert( !c.hasNext() );
assert( !d.hasNext() );
assert( t.find().sort( { i : 1 } ).hint( { i : 1 } ).toArray().length > 10 );

View File

@ -276,6 +276,7 @@
93D948200F7BF4FA00C3C768 /* remove5.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = remove5.js; sourceTree = "<group>"; };
93D949B40F7D2A7700C3C768 /* median.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = median.js; sourceTree = "<group>"; };
93DB94A40FC1BFA30047F950 /* capped3.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = capped3.js; sourceTree = "<group>"; };
93DB95170FC1D3D50047F950 /* capped4.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = capped4.js; sourceTree = "<group>"; };
93DCDB5B0F93ED98005349BC /* nin.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = nin.js; sourceTree = "<group>"; };
93DCDBD30F9515AF005349BC /* file_allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file_allocator.h; sourceTree = "<group>"; };
93E3C5310F704C9D0029011E /* repl4.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = repl4.js; sourceTree = "<group>"; };
@ -578,6 +579,7 @@
93A8D1D10F37544800C92B85 /* jstests */ = {
isa = PBXGroup;
children = (
93DB95170FC1D3D50047F950 /* capped4.js */,
93DB94A40FC1BFA30047F950 /* capped3.js */,
93197CDD0FBDEDD0001FE537 /* shellspawn.js */,
931974610FB8C2BD001FE537 /* count.js */,