0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/mmap_v1/repair_cursor1.js

22 lines
393 B
JavaScript

t = db.repair_cursor1;
t.drop();
t.insert( { x : 1 } );
t.insert( { x : 2 } );
res = t.runCommand( "repairCursor" );
assert( res.ok, tojson( res ) );
t2 = db.repair_cursor1a;
t2.drop();
cursor = new DBCommandCursor( db._mongo, res );
cursor.forEach( function(z){ t2.insert(z); } );
assert.eq( t.find().itcount(), t2.find().itcount() );
assert.eq( t.hashAllDocs(), t2.hashAllDocs() );