| 
					
				 | 
			
			
				@@ -423,3 +423,38 @@ proto.writeExplainOps = function writeExplainOps() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 proto.addInitialSource = function addInitialSource(source) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	this.sources.unshift(source); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//SKIPPED: canRunInMongos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+proto.getDependencies = function getDependencies (initialQuery) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    var deps, knowAllFields = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //NOTE: Deviation from Mongo -- We aren't using Meta and textscore 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    for (var i=0; i < sources.length() && !knowAllFields; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        var localDeps, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	status = sources[i].getDependencies(localDeps); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (status == DocumentSource.GetDepsReturn.NOT_SUPPORTED) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // Assume this stage needs everything. We may still know something about our 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // dependencies if an earlier stage returned either EXHAUSTIVE_FIELDS or 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // EXHAUSTIVE_META. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!knowAllFields) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //C++ insert this range: deps.fields.insert(localDeps.fields.begin(), localDeps.fields.end()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	for (var j = 0; j < localDeps.fields.length; j++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        		deps.fields[localDeps.fields[i].fieldName] = localDeps.fields[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (localDeps.needWholeDocument) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                deps.needWholeDocument = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            knowAllFields = status & DocumentSource.GetDepsReturn.EXHAUSTIVE_FIELDS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (!knowAllFields) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        deps.needWholeDocument = true; // don't know all fields we need 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return deps; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 |