diff options
Diffstat (limited to 'jstests/sharding/count1.js')
-rw-r--r-- | jstests/sharding/count1.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/jstests/sharding/count1.js b/jstests/sharding/count1.js index 2d133f887fc..cd46928ae2b 100644 --- a/jstests/sharding/count1.js +++ b/jstests/sharding/count1.js @@ -101,6 +101,11 @@ assert.eq( 2 , db.foo.find().limit(-2).itcount() , "N2" ); assert.eq( 2 , db.foo.find().skip(4).limit(2).itcount() , "N3" ); assert.eq( 2 , db.foo.find().skip(4).limit(-2).itcount() , "N4" ); +// Make sure count command returns error for invalid queries +var badCmdResult = db.runCommand({ count: 'foo', query: { $c: { $abc: 3 }}}); +assert( ! badCmdResult.ok ); +assert( badCmdResult.errmsg.length > 0 ); + s.stop(); |