diff options
Diffstat (limited to 'jstests/core/exhaust.js')
-rw-r--r-- | jstests/core/exhaust.js | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/jstests/core/exhaust.js b/jstests/core/exhaust.js index fe76916ee95..125c70cefe8 100644 --- a/jstests/core/exhaust.js +++ b/jstests/core/exhaust.js @@ -1,26 +1,25 @@ // @tags: [requires_getmore] (function() { - 'use strict'; +'use strict'; - var c = db.exhaustColl; - c.drop(); +var c = db.exhaustColl; +c.drop(); - const docCount = 4; - for (var i = 0; i < docCount; i++) { - assert.writeOK(c.insert({a: i})); - } +const docCount = 4; +for (var i = 0; i < docCount; i++) { + assert.writeOK(c.insert({a: i})); +} - // Check that the query works without exhaust set - assert.eq(c.find().batchSize(1).itcount(), docCount); - - // Now try to run the same query with exhaust - try { - assert.eq(c.find().batchSize(1).addOption(DBQuery.Option.exhaust).itcount(), docCount); - } catch (e) { - // The exhaust option is not valid against mongos, ensure that this query throws the right - // code - assert.eq(e.code, 18526, () => tojson(e)); - } +// Check that the query works without exhaust set +assert.eq(c.find().batchSize(1).itcount(), docCount); +// Now try to run the same query with exhaust +try { + assert.eq(c.find().batchSize(1).addOption(DBQuery.Option.exhaust).itcount(), docCount); +} catch (e) { + // The exhaust option is not valid against mongos, ensure that this query throws the right + // code + assert.eq(e.code, 18526, () => tojson(e)); +} }()); |