mongojs-hooks.js
function (object) {
		var result = { };
	
		for (var i in object) {
			if (!object.hasOwnProperty(i)) continue;
			
			if (isObject(object[i])) {
				var flatObject = this.flatten(object[i]);
				for (var x in flatObject) {
					if (!flatObject.hasOwnProperty(x)) continue;
					
					result[i + '.' + x] = flatObject[x];
				}
			} else {
				result[i] = object[i];
			}
		}

		return result;
	}
function (object) {
		var result = { };
	
		for (var i in object) {
			if (!object.hasOwnProperty(i)) continue;
			
			if (isObject(object[i])) {
				var flatObject = this.flatten(object[i]);
				for (var x in flatObject) {
					if (!flatObject.hasOwnProperty(x)) continue;
					
					result[i + '.' + x] = flatObject[x];
				}
			} else {
				result[i] = object[i];
			}
		}

		return result;
	}
function ( object ) { var result = { } ; for ( var i in object ) { if ( ! object . hasOwnProperty ( i ) ) continue ; if ( isObject ( object [ i ] ) ) { var flatObject = this . flatten ( object [ i ] ) ; for ( var x in flatObject ) { if ( ! flatObject . hasOwnProperty ( x ) ) continue ; result [ i + '.' + x ] = flatObject [ x ] ; } } else { result [ i ] = object [ i ] ; } } return result ; }
Flattens an object into dot-notation
Flattens an object into dot - notation