build/doc-builder/theme/fixtures/documents/probe.js
function processExpressionObject( val, key ) {
	var operator;
	if ( sys.isObject( val ) ) {
		var opKeys = Object.keys( val );
		var op = opKeys[ 0 ];

		if ( sys.indexOf( nestedOps, op ) > -1 ) {
			operator = processNestedOperator( key, val );
		} else if ( sys.indexOf( prefixOps, key ) > -1 ) {
			operator = processPrefixOperator( key, val );
		} else if ( op === "$regex" ) {
			// special handling for regex options
			operator = processNestedOperator( key, val );
		} else if ( op === "$elemMatch" ) {
			// elemMatch is just a weird duck
			operator = {
				path      : key,
				operation : op,
				operands  : []
			};
			sys.each( val[ op ], function ( entry ) {
				operator.operands = parseQueryExpression( entry );
			} );
		}
		else {
			throw new Error( "Unrecognized operator" );
		}
	} else {
		operator = processNestedOperator( key, { $eq : val } );
	}
	return operator;
}
function processExpressionObject( val, key ) {
	var operator;
	if ( sys.isObject( val ) ) {
		var opKeys = Object.keys( val );
		var op = opKeys[ 0 ];

		if ( sys.indexOf( nestedOps, op ) > -1 ) {
			operator = processNestedOperator( key, val );
		} else if ( sys.indexOf( prefixOps, key ) > -1 ) {
			operator = processPrefixOperator( key, val );
		} else if ( op === "$regex" ) {
			// special handling for regex options
			operator = processNestedOperator( key, val );
		} else if ( op === "$elemMatch" ) {
			// elemMatch is just a weird duck
			operator = {
				path      : key,
				operation : op,
				operands  : []
			};
			sys.each( val[ op ], function ( entry ) {
				operator.operands = parseQueryExpression( entry );
			} );
		}
		else {
			throw new Error( "Unrecognized operator" );
		}
	} else {
		operator = processNestedOperator( key, { $eq : val } );
	}
	return operator;
}
function processExpressionObject ( val , key ) { var operator ; if ( sys . isObject ( val ) ) { var opKeys = Object . keys ( val ) ; var op = opKeys [ 0 ] ; if ( sys . indexOf ( nestedOps , op ) > - 1 ) { operator = processNestedOperator ( key , val ) ; } else if ( sys . indexOf ( prefixOps , key ) > - 1 ) { operator = processPrefixOperator ( key , val ) ; } else if ( op === "$regex" ) { // special handling for regex options operator = processNestedOperator ( key , val ) ; } else if ( op === "$elemMatch" ) { // elemMatch is just a weird duck operator = { path : key , operation : op , operands : [ ] } ; sys . each ( val [ op ] , function ( entry ) { operator . operands = parseQueryExpression ( entry ) ; } ) ; } else { throw new Error ( "Unrecognized operator" ) ; } } else { operator = processNestedOperator ( key , { $eq : val } ) ; } return operator ; }
Interrogates a single query expression object and calls the appropriate handler for its contents
@private
@param {object} val The expression
@param {object} key The prefix
@returns {object} A formatted operation definition
Interrogates a single query expression object and calls the appropriate handler for its contents