Wolfram: Association. Check Value Exist
Check Value Exist by Pattern
MemberQ[asso, pattern]-
check value exist by Pattern. Return
Trueif pattern matches a value.(* check value exist by pattern *) MemberQ[ Association[ a -> 3, b -> 2 ], 3 ] (* True *) MemberQ[ Association[ a -> 3, b -> 2 ], _Integer ] (* True *) MemberQ[ Association[ a -> 3, b -> 2 ], 9 ] (* False *) (* check if there's a value that's list of pairs with second part a even number *) MemberQ[ Association[ a -> {9, 1}, b -> {3, 6} ], {_, _?EvenQ} ] (* True *)