Permalink
Browse files

SERVER-2585 test

  • Loading branch information...
1 parent 1df7425 commit 8b35cf0f945c5636df17709bf03a03f63217273f @astaple astaple committed Jul 19, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 jstests/ork.js
View
@@ -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() );

0 comments on commit 8b35cf0

Please sign in to comment.