diff options
author | Aaron <aaron@10gen.com> | 2009-05-18 16:25:17 -0400 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-05-18 16:25:17 -0400 |
commit | 2117aef610a7dd4b8cbd06d29100fed44cd187ae (patch) | |
tree | 7c2df70079e9d55bc034b77a7cda54c2dfb69eb0 /jstests | |
parent | 46275dbed5f923976c7495e7fb9b2fdb9776fc2f (diff) | |
download | mongo-2117aef610a7dd4b8cbd06d29100fed44cd187ae.tar.gz |
add convertToCapped command
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/capped3.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/jstests/capped3.js b/jstests/capped3.js index 7dc48559af2..4bb6dcc4ea5 100644 --- a/jstests/capped3.js +++ b/jstests/capped3.js @@ -24,4 +24,19 @@ i = 999; while( c.hasNext() ) { assert.eq( i--, c.next().i ); } -assert( i < 990 );
\ No newline at end of file +assert( i < 990 ); + +t.drop(); +t2.drop(); + +for( i = 0; i < 1000; ++i ) { + t.save( {i:i} ); +} +assert.commandWorked( db.runCommand( { convertToCapped:"jstests_capped3", size:1000 } ) ); +c = t.find().sort( {$natural:-1} ); +i = 999; +while( c.hasNext() ) { + assert.eq( i--, c.next().i ); +} +assert( i < 990 ); +assert( i > 900 );
\ No newline at end of file |