0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/capped.js
2009-01-31 17:22:22 -05:00

11 lines
223 B
JavaScript

db.capped.drop();
db.createCollection("cptest", {capped:true, size:30000});
t = db.cptest;
t.save({x:1});
t.save({x:2});
assert( t.find().sort({$natural:1})[0].x == 1 );
assert( t.find().sort({$natural:-1})[0].x == 2 );