mocks.js
function(obj) {
		var result = {type : this.type};
		this.db.validateFields(this.type, this.fields);
		for(var i = 0; i < this.fields.length; i++) {
			var fName = this.fields[i];
			result[fName] = obj[fName];
		}
		for(var i = 0; i < this.subqueries.length; i++) {
			var sq = this.subqueries[i];
			result[sq.relationship] = sq.getResult(obj);
		}
		return result
	}
function(obj) {
		var result = {type : this.type};
		this.db.validateFields(this.type, this.fields);
		for(var i = 0; i < this.fields.length; i++) {
			var fName = this.fields[i];
			result[fName] = obj[fName];
		}
		for(var i = 0; i < this.subqueries.length; i++) {
			var sq = this.subqueries[i];
			result[sq.relationship] = sq.getResult(obj);
		}
		return result
	}
A mothod to create a result object out of a resolved object in the db