summaryrefslogtreecommitdiff
path: root/jstests/slowNightly/cursor8.js
blob: b50fe3b26d169bd1a666ad556ab6beb54a3d810d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// This should get skipped when testing replication.

t = db.cursor8;
t.drop();
t.save( {} );
t.save( {} );
t.save( {} );

assert.eq( 3 , t.find().count() , "A0" );

db.getMongo().getDB( "admin" ).runCommand( {closeAllDatabases:1} );

function test( want , msg ){
    var res = db.runCommand( { cursorInfo:1 } );
    assert.eq( want , res.clientCursors_size , msg + " " + tojson( res ) );
}

test( 0 , "A1" );
assert.eq( 3 , t.find().count() , "A2" );
assert.eq( 3 , t.find( {} ).count() , "A3" );
assert.eq( 2, t.find( {} ).limit( 2 ).itcount() , "A4" );
test( 1 , "B1" );