Was this page helpful?

Map.Select

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

    Create a map that only contains key-value pairs for which the condition succeeds.

    Usage Restrictions

    1.9.1 or later

    Parameters

    Name Type Description
    map
    map The map value.
    condition
    str condition to execute for each item (use '$' to refer to the key-value pair)

     

    Result

    a map that has all the key-value pairs that follow the given condition.

    Samples


    Output

    to get a map of a key-values that fulfill your conditions:

    {{ map.select({one:2, two:4}, "$.value==2") }} 

     

    { one : 2 }

    to get a map of a key-values that fulfill your conditions:

    {{ map.select({one:2, two:4}, "$.key=='two'") }} 

     

    { two : 4 }
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by