Was this page helpful?

Map.Apply

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    map.Apply( map :  map, expression : str) : map
    

    Create a new map by applying the expression to each key value pair.

    Usage Restrictions

    1.9.1 or later

    Parameters

    Name Type Description
    map
    map
    the map value
    expression
    str
    the expression that will be applied to the key value pair

    Result

    A map with the specified expression applied to the key value pair.

    (NOTE:  You cannot change keys once you have created them, therefore, if you try to change the keys using map.apply, it
    will complete the given expression. But instead of changing the key, it will put the new expression in the value.)

    Samples


    Output

    to apply an expression to a map:

    {{map.apply({one:1,two:2}, "$.value*2") }}  

     

    { one : 2, two : 4 }

    to apply an expression to a map:

    {{ map.apply({one:1,two:2}, "$.key..'_test'") }}  

     

    { one : "one_test", two : "two_test" }
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by