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