Browse Source

Refs #5121: Move documentFromBson/parseDeps

Chris Sexton 12 years ago
parent
commit
3adbc68364
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lib/pipeline/documentSources/DocumentSource.js

+ 4 - 4
lib/pipeline/documentSources/DocumentSource.js

@@ -233,7 +233,7 @@ proto.serializeToArray = function serializeToArray(array, explain) {
 //      All other fields should be missing which means not needed
 //      All other fields should be missing which means not needed
 // DocumentSource::ParsedDeps DocumentSource::parseDeps(const set<string>& deps) {
 // DocumentSource::ParsedDeps DocumentSource::parseDeps(const set<string>& deps) {
 //  MutableDocument md;
 //  MutableDocument md;
-proto.parseDeps = function parseDeps(deps) {
+klass.parseDeps = function parseDeps(deps) {
 	var doc,
 	var doc,
 		last;
 		last;
 
 
@@ -253,13 +253,13 @@ proto.parseDeps = function parseDeps(deps) {
 	return doc;
 	return doc;
 };
 };
 
 
-proto.documentFromBsonWithDeps = function documentFromBsonWithDeps(obj, deps) {
+klass.documentFromJsonWithDeps = function documentFromJsonWithDeps(obj, deps) {
 	var doc = {},
 	var doc = {},
 		self = this;
 		self = this;
 
 
 	var arrayHelper = function(field, isNeeded) {
 	var arrayHelper = function(field, isNeeded) {
 		return field.map(function(f) {
 		return field.map(function(f) {
-			self.documentFromBsonWithDeps(f, isNeeded);
+			DocumentSource.documentFromJsonWithDeps(f, isNeeded);
 		});
 		});
 	};
 	};
 
 
@@ -283,7 +283,7 @@ proto.documentFromBsonWithDeps = function documentFromBsonWithDeps(obj, deps) {
 			Object.setAtPath(doc, fieldName, arrayHelper(field, isNeeded));
 			Object.setAtPath(doc, fieldName, arrayHelper(field, isNeeded));
 
 
 		if (field instanceof Object) { // everything is...
 		if (field instanceof Object) { // everything is...
-			var sub = this.documentFromBsonWithDeps(field, isNeeded);
+			var sub = DocumentSource.documentFromJsonWithDeps(field, isNeeded);
 			Object.setAtPath(doc, fieldName, sub);
 			Object.setAtPath(doc, fieldName, sub);
 		}
 		}
 	}
 	}