Files
mongo/jstests/core/sort3.js
David Storch 645e9ad9db SERVER-17544 update tests depending on OP_QUERY/OP_GET_MORE specific behavior
--Use of 'orderby' is not allowed for find command.
--Passing a negative value for .batchSize() is no longer legal.
--Find command accepts 64-bit skip and limit values.
--Slow log line format has changed for find command.
2015-07-28 16:21:12 -04:00

12 lines
358 B
JavaScript

t = db.sort3;
t.drop();
t.save( { a : 1 } );
t.save( { a : 5 } );
t.save( { a : 3 } );
assert.eq( "1,5,3" , t.find().toArray().map( function(z){ return z.a; } ) );
assert.eq( "1,3,5" , t.find().sort( { a : 1 } ).toArray().map( function(z){ return z.a; } ) );
assert.eq( "5,3,1" , t.find().sort( { a : -1 } ).toArray().map( function(z){ return z.a; } ) );