Files
mongo/jstests/tempCleanup.js
Eliot Horowitz 08a30732d9 clean up temporary collection handling
fix memory leak when dropping temp collections
2010-07-07 10:06:04 -04:00

17 lines
298 B
JavaScript

mydb = db.getSisterDB( "temp_cleanup_test" )
t = mydb.tempCleanup
t.drop()
t.insert( { x : 1 } )
res = t.mapReduce( function(){ emit(1,1); } , function(){ return 1; } );
printjson( res );
assert.eq( 1 , t.count() , "A1" )
assert.eq( 1 , mydb[res.result].count() , "A2" )
mydb.dropDatabase()