docs: function get_results(Type, opts) {
  	opts = opts || {};
  
  	var field_map;
  	if(is.func(opts.fieldMap)) {
  		field_map = opts.fieldMap;
  	} else if(is.obj(opts.fieldMap)) {
  		field_map = function(k) {
  			return opts.fieldMap[k];
  		};
  	}
  
  	/** Parse field */
  	function parse_field(obj, key, value) {
  		debug.assert(obj).is('object');
  		//debug.log('obj = ', obj);
  		//debug.log('key = ', key);
  		//debug.log('value = ', value);
  
  		/* Parse full top level field */
  		function parse_field_top(obj, key, value) {
  			if( is.array(obj['$'+key]) ) {
  				obj['$'+key] = obj['$'+key].concat(value);
  			} else if( is.obj(obj['$'+key]) ) {
  				obj['$'+key] = merge(obj['$'+key], value);
  			} else {
  				obj['$'+key] = value;
  			}
  		}
  
  		/* Parse property in top level field based on a key as an array `[datakey, property_name]` */
  		function parse_field_property(obj, key, value) {
  			//debug.log('key = ', key);
  			var a = key[0];
  			var b = key[1];
  			//debug.log('key_a = ', a);
  			//debug.log('key_b = ', b);
  
  			if(!is.obj(obj['$'+a])) {
  				obj['$'+a] = {};
  			}
  
  			obj['$'+a][b] = value;
  		}
  
  		/* Parse property in top level field based on key in PostgreSQL JSON format */
  		function parse_field_property_pg(obj, key, value) {
  			//debug.log('key = ', key);
  			/*jslint regexp: false*/
  			var matches = /^([a-z][a-z0-9\_]*)\-\>\>'([^\']+)'$/.exec(key);
  			/*jslint regexp: true*/
  			var a = matches[1];
  			var b = matches[2];
  			return parse_field_property_pg(obj, [a,b], value);
  		}
  
  		//
  		var new_key;
  		if( is.func(field_map) && (new_key = field_map(key)) ) {
  			if( (new_key) && (new_key !== key) ) {
  				return parse_field(obj, new_key, value);
  			}
  		}
  
  		if( is.array(key) ) {
  			parse_field_property(obj, key, value);
  		} else if( is.string(key) && (/^[a-z][a-z0-9\_]*$/.test(key)) ) {
  			parse_field_top(obj, key, value);
  		/*jslint regexp: false*/
  		} else if ( is.string(key) && (/^([a-z][a-z0-9\_]*)\-\>\>'([^\']+)'$/.test(key)) ) {
  		/*jslint regexp: true*/
  			parse_field_property_pg(obj, key, value);
  		} else {
  			//debug.log('key = ', key);
  			throw new TypeError("Unknown field name: " + key);
  		}
  	}
  
  	/* Returns a function which will go through rows and convert them to NoPg format */
  	return function(rows) {
  		return ARRAY(rows).map(function(row, i) {
  			if(!row) { throw new TypeError("failed to parse result #" + i + " from database!"); }
  			//debug.log('input in row = ', row);
  
  			//debug.log('row = ', row);
  
  			if(row instanceof Type) {
  				return row;
  			}
  
  			var obj = {};
  			ARRAY(Object.keys(row)).forEach(function(key) {
  
  				if(key === 'documents') {
  					obj['$'+key] = {};
  					ARRAY(Object.keys(row[key])).forEach(function(uuid) {
  						if(!is.uuid(uuid)) {
  							obj['$'+key][uuid] = row[key][uuid];
  							return;
  						}
  						var sub_doc = row[key][uuid];
  						var sub_obj = {};
  						ARRAY(Object.keys(sub_doc)).forEach(function(k) {
  							parse_field(sub_obj, k, sub_doc[k]);
  						});
  						obj['$'+key][uuid] = new NoPg.Document(sub_obj);
  					});
  					return;
  				}
  
  				parse_field(obj, key, row[key]);
  			});
  
  			_parse_object_expressions(obj);
  
  			//debug.log('result in obj = ', obj);
  			return new Type(obj);
  		}).valueOf();
  	};
  }