|
|
@@ -1,6 +1,6 @@
|
|
|
"use strict";
|
|
|
|
|
|
-/**
|
|
|
+/**
|
|
|
* Constructor for MinMaxAccumulator, wraps SingleValueAccumulator's constructor and adds flag to track whether we have started or not
|
|
|
* @class MinMaxAccumulator
|
|
|
* @namespace mungedb-aggregate.pipeline.accumulators
|
|
|
@@ -12,7 +12,7 @@ var MinMaxAccumulator = module.exports = function MinMaxAccumulator(sense){
|
|
|
base.call(this);
|
|
|
this.sense = sense; /* 1 for min, -1 for max; used to "scale" comparison */
|
|
|
if (this.sense !== 1 && this.sense !== -1) throw new Error("this should never happen");
|
|
|
-}, klass = MinMaxAccumulator, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
+}, klass = MinMaxAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
// DEPENDENCIES
|
|
|
var Value = require("../Value");
|
|
|
@@ -50,4 +50,4 @@ proto.processInternal = function processInternal(input, merging) {
|
|
|
}
|
|
|
|
|
|
return this.value;
|
|
|
-};
|
|
|
+};
|