summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-14 21:10:37 -0500
committerEliot Horowitz <eliot@10gen.com>2009-12-14 21:10:37 -0500
commitc6420d62e0748d5df85cc0499126c3e797c3f6cc (patch)
treeb134a8938479b3a02ae2009a8739cc130e5a6439 /jstests
parent807216811773c80e47d75be43dca5da4c646e283 (diff)
downloadmongo-c6420d62e0748d5df85cc0499126c3e797c3f6cc.tar.gz
test for SERVER-486
Diffstat (limited to 'jstests')
-rw-r--r--jstests/index_check7.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/jstests/index_check7.js b/jstests/index_check7.js
new file mode 100644
index 00000000000..68102d61353
--- /dev/null
+++ b/jstests/index_check7.js
@@ -0,0 +1,15 @@
+
+t = db.index_check7
+t.drop()
+
+for ( var i=0; i<100; i++ )
+ t.save( { x : i } )
+
+t.ensureIndex( { x : 1 } )
+assert.eq( 1 , t.find( { x : 27 } ).explain().nscanned , "A" )
+
+t.ensureIndex( { x : -1 } )
+assert.eq( 1 , t.find( { x : 27 } ).explain().nscanned , "B" )
+
+assert.eq( 41 , t.find( { x : { $gt : 59 } } ).explain().nscanned , "C" );
+