|
@@ -6,22 +6,22 @@ var Pipeline = module.exports = (function(){
|
|
|
|
|
|
|
|
}, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
}, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
|
|
-// var GroupDocumentSource = require('./documentSources/GroupDocumentSource'),
|
|
|
|
|
-// LimitDocumentSource = require('./documentSources/LimitDocumentSource'),
|
|
|
|
|
-// MatchDocumentSource = require('./documentSources/MatchDocumentSource'),
|
|
|
|
|
-// ProjectDocumentSource = require('./documentSources/ProjectDocumentSource'),
|
|
|
|
|
|
|
+ var LimitDocumentSource = require('./documentSources/LimitDocumentSource'),
|
|
|
|
|
+ MatchDocumentSource = require('./documentSources/MatchDocumentSource'),
|
|
|
|
|
+ ProjectDocumentSource = require('./documentSources/ProjectDocumentSource');
|
|
|
|
|
+// GroupDocumentSource = require('./documentSources/GroupDocumentSource'),
|
|
|
// SkipDocumentSource = require('./documentSources/SkipDocumentSource'),
|
|
// SkipDocumentSource = require('./documentSources/SkipDocumentSource'),
|
|
|
// SortDocumentSource = require('./documentSources/SortDocumentSource'),
|
|
// SortDocumentSource = require('./documentSources/SortDocumentSource'),
|
|
|
// UnwindDocumentSource = require('./documentSources/UnwindDocumentSource');
|
|
// UnwindDocumentSource = require('./documentSources/UnwindDocumentSource');
|
|
|
|
|
|
|
|
klass.StageDesc = {};//attaching this to the class for test cases
|
|
klass.StageDesc = {};//attaching this to the class for test cases
|
|
|
-// StageDesc[GroupDocumentSource.groupName] = GroupDocumentSource;
|
|
|
|
|
-// StageDesc[LimitDocumentSource.limitName] = LimitDocumentSource;
|
|
|
|
|
-// StageDesc[MatchDocumentSource.matchName] = MatchDocumentSource;
|
|
|
|
|
-// StageDesc[ProjectDocumentSource.projectName] = ProjectDocumentSource;
|
|
|
|
|
-// StageDesc[SkipDocumentSource.skipName] = SkipDocumentSource;
|
|
|
|
|
-// StageDesc[SortDocumentSource.sortName] = SortDocumentSource;
|
|
|
|
|
-// StageDesc[UnwindDocumentSource.unwindName] = UnwindDocumentSource;
|
|
|
|
|
|
|
+ klass.StageDesc[LimitDocumentSource.limitName] = LimitDocumentSource;
|
|
|
|
|
+ klass.StageDesc[MatchDocumentSource.matchName] = MatchDocumentSource;
|
|
|
|
|
+ klass.StageDesc[ProjectDocumentSource.projectName] = ProjectDocumentSource;
|
|
|
|
|
+// klass.StageDesc[GroupDocumentSource.groupName] = GroupDocumentSource;
|
|
|
|
|
+// klass.StageDesc[SkipDocumentSource.skipName] = SkipDocumentSource;
|
|
|
|
|
+// klass.StageDesc[SortDocumentSource.sortName] = SortDocumentSource;
|
|
|
|
|
+// klass.StageDesc[UnwindDocumentSource.unwindName] = UnwindDocumentSource;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Create a pipeline from the command.
|
|
* Create a pipeline from the command.
|
|
@@ -84,9 +84,9 @@ var Pipeline = module.exports = (function(){
|
|
|
*/
|
|
*/
|
|
|
for(var srcn = sourceVector.length, srci = 1; srci < srcn; ++srci) {
|
|
for(var srcn = sourceVector.length, srci = 1; srci < srcn; ++srci) {
|
|
|
var source = sourceVector[srci];
|
|
var source = sourceVector[srci];
|
|
|
- if (source.constructor === klass.MatchDocumentSource) { //TODO: remove 'klass.' once match is implemented!!!
|
|
|
|
|
|
|
+ if (source.constructor === MatchDocumentSource) {
|
|
|
var previous = sourceVector[srci - 1];
|
|
var previous = sourceVector[srci - 1];
|
|
|
- if (previous.constructor === klass.SortDocumentSource) { //TODO: remove 'sort.' once match is implemented!!!
|
|
|
|
|
|
|
+ if (previous.constructor === klass.SortDocumentSource) { //TODO: remove 'sort.' once sort is implemented!!!
|
|
|
/* swap this item with the previous */
|
|
/* swap this item with the previous */
|
|
|
sourceVector[srci - 1] = source;
|
|
sourceVector[srci - 1] = source;
|
|
|
sourceVector[srci] = previous;
|
|
sourceVector[srci] = previous;
|