structFindValue

Description

Searches recursively through a substructure of nested arrays, structures, and other elements for structures with values that match the search key in the valueparameter.

Categories

Syntax

StructFindValue( top, value [, scope])

Attributes

AttributeDescriptionRequiredDefault
scopeone: function returns one matching key (default). all: function returns all matching keys.
topColdFusion structure from which to start search. This parameter requires an object, not a name of an object.
valueString or a variable that contains one for which to search. The type must be a simple object. Arrays and structures are not supported.

Returns

An array that contains structures with values that match the search key value. If none are found, returns an array of size 0.

Usage

The fields of each structure in the returned array are:
Key: name of the key in which the value was found
Path: string which could be used to reach the found key
Owner: parent object that contains the found key
A structure’s keys are unordered.

Example

<cfset aResults = StructFindValue( #request#, "235" )>