Description

Sets metadata on the array element(s).

Returns

Nothing

History

Added in ColdFusion (2016 release) Update 2

Category

See also

Syntax

ArraySetMetaData(Array array, Struct metadata)

Parameters

Parameter Description
array The input array.
metadata The metadata to be applied to the array element(s).

Example

<cfscript>
       inputs = ["2500.12", 4.0, "Yes", "False", "339090", {"q1": "Yes"}, ["1","yes","3","no","null","null"]];
       metadata={items: ["numeric", "integer", "string", "boolean", "string", {q1: {type:"string",ignore:true}}, 
       {items: ["integer","boolean","string","string","string","null"]}]};
       ArraySetMetaData(inputs,metadata);
       writeoutput(serializeJSON(inputs));
</cfscript>

Output

[2500.12,4,"Yes",false,"339090",{},[1,true,"3","no","null","null"]]

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy