summaryrefslogtreecommitdiff
path: root/jstests/aggregation/bugs/server533.js
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2015-07-20 15:59:22 -0400
committerCharlie Swanson <charlie.swanson@mongodb.com>2015-07-20 15:59:22 -0400
commit4f1dda92ed5976ab950e2eaaaffd7bd20296a066 (patch)
treefada7dc1789ef2e5e037029deb542ea4fc5670e5 /jstests/aggregation/bugs/server533.js
parent824776f67165d4ee0447c1e855dcd8a79643b73c (diff)
downloadmongo-4f1dda92ed5976ab950e2eaaaffd7bd20296a066.tar.gz
Revert "$sample"
This reverts commit 824776f67165d4ee0447c1e855dcd8a79643b73c.
Diffstat (limited to 'jstests/aggregation/bugs/server533.js')
-rw-r--r--jstests/aggregation/bugs/server533.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/jstests/aggregation/bugs/server533.js b/jstests/aggregation/bugs/server533.js
deleted file mode 100644
index 3b8101444e0..00000000000
--- a/jstests/aggregation/bugs/server533.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// SERVER-533: Aggregation stage to randomly sample documents.
-
-// For assertErrorCode.
-load('jstests/aggregation/extras/utils.js');
-
-(function() {
- 'use strict';
-
- var coll = db.agg_sample;
- coll.drop();
-
- var nItems = 3;
- for (var i = 0; i < nItems; i++) {
- assert.writeOK(coll.insert({_id: i}));
- }
-
- [0, 1, nItems, nItems + 1].forEach(function(size) {
- var results = coll.aggregate([{$sample: {size: size}}]).toArray();
- assert.eq(results.length, Math.min(size, nItems));
- });
-
- // Multiple $sample stages are allowed.
- var results = coll.aggregate([{$sample: {size: nItems}}, {$sample: {size: 1}}]).toArray();
- assert.eq(results.length, 1);
-
- // Invalid options.
- assertErrorCode(coll, [{$sample: 'string'}], 28739);
- assertErrorCode(coll, [{$sample: {size: 'string'}}], 28740);
- assertErrorCode(coll, [{$sample: {size: -1}}], 28741);
- assertErrorCode(coll, [{$sample: {unknownOpt: true}}], 28742);
- assertErrorCode(coll, [{$sample: {/* no size */}}], 28743);
-}());