|
|
@@ -42,6 +42,7 @@ klass.prepareCursorSource = function prepareCursorSource(pipeline, expCtx){
|
|
|
|
|
|
// Look for an initial simple project; we'll avoid constructing Values for fields that won't make it through the projection
|
|
|
var projection = {};
|
|
|
+ var dependencies;
|
|
|
var deps = {};
|
|
|
var status = DocumentSource.GetDepsReturn.SEE_NEXT;
|
|
|
for (var i=0; i < sources.length && status !== DocumentSource.GetDepsReturn.EXHAUSTIVE; i++) {
|
|
|
@@ -52,6 +53,7 @@ klass.prepareCursorSource = function prepareCursorSource(pipeline, expCtx){
|
|
|
}
|
|
|
if (status === DocumentSource.GetDepsReturn.EXHAUSTIVE) {
|
|
|
projection = DocumentSource.depsToProjection(deps);
|
|
|
+ dependencies = DocumentSource.parseDeps(deps);
|
|
|
}
|
|
|
|
|
|
// NOTE: SKIPPED: Look for an initial sort
|
|
|
@@ -81,7 +83,7 @@ klass.prepareCursorSource = function prepareCursorSource(pipeline, expCtx){
|
|
|
|
|
|
// NOTE: SKIPPED: Note the query and sort
|
|
|
|
|
|
- if (Object.keys(projection).length) source.setProjection(projection);
|
|
|
+ if (Object.keys(projection).length) source.setProjection(projection, dependencies);
|
|
|
|
|
|
while(sources.length > 0 && source.coalesce(sources[0])) { //Note: Attempting to coalesce into the cursor source
|
|
|
sources.shift();
|