summaryrefslogtreecommitdiff
path: root/jstests/ork.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2011-07-18 20:15:19 -0700
committerAaron <aaron@10gen.com>2011-07-31 08:59:01 -0700
commit8b35cf0f945c5636df17709bf03a03f63217273f (patch)
tree013ff9cbe2263aeb956467dd14432d8c35bad83a /jstests/ork.js
parent1df742557ac82a54c1c935ba026aac73d836203d (diff)
downloadmongo-8b35cf0f945c5636df17709bf03a03f63217273f.tar.gz
SERVER-2585 test
Diffstat (limited to 'jstests/ork.js')
-rw-r--r--jstests/ork.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/jstests/ork.js b/jstests/ork.js
new file mode 100644
index 00000000000..d6d40161e69
--- /dev/null
+++ b/jstests/ork.js
@@ -0,0 +1,11 @@
+// SERVER-2585 Test $or clauses within indexed top level $or clauses.
+
+t = db.jstests_ork;
+t.drop();
+
+t.ensureIndex( {a:1} );
+t.save( {a:[1,2],b:5} );
+t.save( {a:[2,4],b:5} );
+
+assert.eq( 2, t.find( {$or:[{a:1,$and:[{$or:[{a:2},{a:3}]},{$or:[{b:5}]}]},{a:2,$or:[{a:3},{a:4}]}]} ).itcount() );
+assert.eq( 1, t.find( {$or:[{a:1,$and:[{$or:[{a:2},{a:3}]},{$or:[{b:6}]}]},{a:2,$or:[{a:3},{a:4}]}]} ).itcount() );