Permalink
Browse files

add some fast count $where clause checks

  • Loading branch information...
1 parent d3f5999 commit 3f564bdae6adc11d0cefac87c76764e9eb4ace1e @astaple astaple committed Jan 17, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 jstests/countb.js
View
@@ -7,3 +7,5 @@ t.ensureIndex( {a:1} );
t.save( {a:['a','b']} );
assert.eq( 0, t.find( {a:{$in:['a'],$gt:'b'}} ).count() );
assert.eq( 0, t.find( {$and:[{a:'a'},{a:{$gt:'b'}}]} ).count() );
+assert.eq( 1, t.find( {$and:[{a:'a'},{$where:"this.a[1]=='b'"}]} ).count() );
+assert.eq( 0, t.find( {$and:[{a:'a'},{$where:"this.a[1]!='b'"}]} ).count() );

0 comments on commit 3f564bd

Please sign in to comment.