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

17 lines
323 B
JavaScript
Raw Normal View History

2009-01-27 05:28:26 +01:00
// Test object id sorting.
function testObjectIdFind( db ) {
r = db.ed_db_find2_oif;
r.drop();
for( i = 0; i < 3; ++i )
r.save( {} );
f = r.find().sort( { _id: 1 } );
assert.eq( 3, f.count() );
assert( f[ 0 ]._id < f[ 1 ]._id );
assert( f[ 1 ]._id < f[ 2 ]._id );
}
2009-01-31 23:22:22 +01:00
testObjectIdFind( db );