summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-05-18 16:25:17 -0400
committerAaron <aaron@10gen.com>2009-05-18 16:25:17 -0400
commit2117aef610a7dd4b8cbd06d29100fed44cd187ae (patch)
tree7c2df70079e9d55bc034b77a7cda54c2dfb69eb0 /jstests
parent46275dbed5f923976c7495e7fb9b2fdb9776fc2f (diff)
downloadmongo-2117aef610a7dd4b8cbd06d29100fed44cd187ae.tar.gz
add convertToCapped command
Diffstat (limited to 'jstests')
-rw-r--r--jstests/capped3.js17
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