summaryrefslogtreecommitdiff
path: root/jstests/maxscan.js
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-08-11 12:38:57 +0200
committerAntonin Kral <a.kral@bobek.cz>2010-08-11 12:38:57 +0200
commit7645618fd3914cb8a20561625913c20d49504a49 (patch)
tree8370f846f58f6d71165b7a0e2eda04648584ec76 /jstests/maxscan.js
parent68c73c3c7608b4c87f07440dc3232801720b1168 (diff)
downloadmongodb-7645618fd3914cb8a20561625913c20d49504a49.tar.gz
Imported Upstream version 1.6.0
Diffstat (limited to 'jstests/maxscan.js')
-rw-r--r--jstests/maxscan.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/maxscan.js b/jstests/maxscan.js
new file mode 100644
index 0000000..c455efb
--- /dev/null
+++ b/jstests/maxscan.js
@@ -0,0 +1,14 @@
+
+t = db.maxscan;
+t.drop();
+
+N = 100;
+for ( i=0; i<N; i++ ){
+ t.insert( { _id : i , x : i % 10 } );
+}
+
+assert.eq( N , t.find().itcount() , "A" )
+assert.eq( 50 , t.find()._addSpecial( "$maxScan" , 50 ).itcount() , "B" )
+
+assert.eq( 10 , t.find( { x : 2 } ).itcount() , "C" )
+assert.eq( 5 , t.find( { x : 2 } )._addSpecial( "$maxScan" , 50 ).itcount() , "D" )