Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add a test for with multiple get mores interleaved with other operations

  • Loading branch information...
commit 390abf36eb36705f5f9f7a5542f63376053e131a 1 parent 6988da3
@astaple astaple authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 jstests/oro.js
View
27 jstests/oro.js
@@ -0,0 +1,27 @@
+// Test $or query with several clauses on separate indexes.
+
+t = db.jstests_oro;
+t.drop();
+
+orClauses = [];
+for( idxKey = 'a'; idxKey <= 'aaaaaaaaaa'; idxKey += 'a' ) {
+ idx = {}
+ idx[ idxKey ] = 1;
+ t.ensureIndex( idx );
+ for( i = 0; i < 200; ++i ) {
+ t.insert( idx );
+ }
+ orClauses.push( idx );
+}
+
+printjson( t.find({$or:orClauses}).explain() );
+c = t.find({$or:orClauses}).batchSize( 100 );
+count = 0;
+
+while( c.hasNext() ) {
+ for( i = 0; i < 50 && c.hasNext(); ++i, c.next(), ++count );
+ // Interleave with another operation.
+ t.stats();
+}
+
+assert.eq( 10 * 200, count );
Please sign in to comment.
Something went wrong with that request. Please try again.