|
@@ -10,13 +10,13 @@ var DocumentSource = require('./DocumentSource');
|
|
|
* @param [ctx] {ExpressionContext}
|
|
* @param [ctx] {ExpressionContext}
|
|
|
**/
|
|
**/
|
|
|
var OutDocumentSource = module.exports = function OutDocumentSource(outputNs, ctx){
|
|
var OutDocumentSource = module.exports = function OutDocumentSource(outputNs, ctx){
|
|
|
- if (arguments.length > 2) throw new Error("up to two arg expected");
|
|
|
|
|
|
|
+ if (arguments.length > 2) throw new Error("up to two args expected");
|
|
|
base.call(this, ctx);
|
|
base.call(this, ctx);
|
|
|
// defaults
|
|
// defaults
|
|
|
this._done = false;
|
|
this._done = false;
|
|
|
this._outputNs = outputNs;
|
|
this._outputNs = outputNs;
|
|
|
this._collectionName = "";
|
|
this._collectionName = "";
|
|
|
-}, klass = OutDocumentSource, base = require('./DocumentSource'), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
|
+}, klass = OutDocumentSource, base = DocumentSource, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
|
|
klass.outName = "$out";
|
|
klass.outName = "$out";
|
|
|
|
|
|
|
@@ -47,6 +47,12 @@ klass.createFromJson = function(jsonElement, ctx) {
|
|
|
return out;
|
|
return out;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// SplittableDocumentSource implementation.
|
|
|
|
|
+klass.isSplittableDocumentSource = true;
|
|
|
|
|
+
|
|
|
|
|
+//NeedsMongodDocumentSource implementation
|
|
|
|
|
+klass.needsMongodDocumentSource = true;
|
|
|
|
|
+
|
|
|
proto.getDependencies = function(deps) {
|
|
proto.getDependencies = function(deps) {
|
|
|
deps.needWholeDocument = true;
|
|
deps.needWholeDocument = true;
|
|
|
return DocumentSource.GetDepsReturn.EXHAUSTIVE;
|
|
return DocumentSource.GetDepsReturn.EXHAUSTIVE;
|