json.remove: Difference between revisions
Jump to navigation
Jump to search
(New page: ==Function json.remove== '''Introduced in MapTool 1.3b49''' Removes a field from a Macros:json object, or the value at the specified index from a json array. ...) |
Verisimilar (talk | contribs) m (Applied Template:MacroFunction) |
||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=json.remove | |||
|version=1.3b49 | |||
|description= | |||
Removes a field from a [[Macros:json object|json object]], or the value at the specified index from a [[Macros:json array|json array]]. | Removes a field from a [[Macros:json object|json object]], or the value at the specified index from a [[Macros:json array|json array]]. | ||
|usage= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: jarr = json.remove(jarr, index)] | [h: jarr = json.remove(jarr, index)] | ||
Line 12: | Line 11: | ||
</source> | </source> | ||
|examples= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h:a=json.fromStrProp("a=1;b=44;c=12")] [r:json.remove(a, "c")] | [h:a=json.fromStrProp("a=1;b=44;c=12")] [r:json.remove(a, "c")] | ||
Line 22: | Line 20: | ||
{"a":1,"b":44} | {"a":1,"b":44} | ||
["a",1,"g"] | ["a",1,"g"] | ||
}} | |||
[[Category:JSON Function]] |
Revision as of 02:27, 9 March 2009
json.remove() Function
• Introduced in version 1.3b49
Removes a field from a json object, or the value at the specified index from a json array.
Usage
[h: jarr = json.remove(jarr, index)]
[h: jarr = json.remove(jobj, key)]
Examples
[h:a=json.fromStrProp("a=1;b=44;c=12")] [r:json.remove(a, "c")]
[h:a=json.fromList("a,1,g,4")][r:json.remove(a,3)]
Returns
{"a":1,"b":44}["a",1,"g"]