Adding Custom Smart Filter crash

I tried to add a Custom Smart Filter with an example from the Handbook.
$[category == "Letter"]
But Glyph crash just after running “OK” button. Is this expression wrong?

Additional question :
It’s possible to create a smart filter that check if masterLayer has specific userData ?
Or smart filter work only with glyph ?

Typically I would like to create a smart filter similar to :
if glyph.layers[font.selectedFontMaster.id].userData["myData"]

Can you post a screenshot what you put in the filter UI?

Without $[ ] it work, my bad.
category == "Letter"

How can I check userData ?

Code to add userData[“myData”]=data to selected glyph.

font = Glyphs.font
selectedGlyph = font.selection

for glyph in selectedGlyph:
	glyph.userData["myData"]="data"

Work if I replace

"myData" IN glyph.userData

by

"data" IN glyph.userData

(I know glyph. in not needed)

I’m struggling to create a specific Custom Filter.
I assigned some userData to layers like in this example

font = Glyphs.font
font.glyphs["A"].layers[0].userData["test"] = {"key1":True, "key2":False}

How can I create a Custom Filter to filter glyphs with layer.userData["test"]["key1"] = True ?