summaryrefslogtreecommitdiff
path: root/jstests
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
parent824776f67165d4ee0447c1e855dcd8a79643b73c (diff)
downloadmongo-4f1dda92ed5976ab950e2eaaaffd7bd20296a066.tar.gz
Revert "$sample"
This reverts commit 824776f67165d4ee0447c1e855dcd8a79643b73c.
Diffstat (limited to 'jstests')
-rw-r--r--jstests/aggregation/bugs/server533.js32
-rw-r--r--jstests/aggregation/testshard1.js9
2 files changed, 0 insertions, 41 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);
-}());
diff --git a/jstests/aggregation/testshard1.js b/jstests/aggregation/testshard1.js
index ab49ad5653a..71271ca0af5 100644
--- a/jstests/aggregation/testshard1.js
+++ b/jstests/aggregation/testshard1.js
@@ -226,15 +226,6 @@ function testAvgStdDev() {
}
testAvgStdDev();
-function testSample() {
- jsTestLog('testing $sample');
- [0, 1, 10, nItems, nItems + 1].forEach(function(size) {
- var res = db.ts1.aggregate([{$sample: {size: size}}]).toArray();
- assert.eq(res.length, Math.min(nItems, size));
- });
-}
-testSample();
-
jsTestLog('test $out by copying source collection verbatim to output');
var outCollection = db.ts1_out;
var res = aggregateOrdered(db.ts1, [{$out: outCollection.getName()}]);