Help needed for JSONPATH transformation

I find it’s worth working out complex JSONPATH transforms in a rule.

val rawjson = '{"dxsEntries":[{"dxsId":67109120,"value":5860.546875},{"dxsId":16780032,"value":3}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}'

// first we'll make sure we can extract array elements by position
var results = transform("JSONPATH", "$.dxsEntries.[0].dxsId", rawjson)
logInfo("test", " first array element ID " + results)
results = transform("JSONPATH", "$.dxsEntries.[0].value", rawjson)
logInfo("test", " first array element value " + results)

// next, instead of by position like [0] or [1]
// we can select array elements by a ? query match to ID field
results = transform("JSONPATH", "$.dxsEntries.[?(@.dxsId==16780032)].value", rawjson)
logInfo("test", " path matching " + results)
results = transform("JSONPATH", "$.dxsEntries.[?(@.dxsId==67109120)].value", rawjson)
logInfo("test", " path matching " + results)
results = transform("JSONPATH", "$.dxsEntries.[?(@.dxsId==99)].value", rawjson)
logInfo("test", " path matching " + results)

first array element ID 67109120
first array element value 5860.546875
path matching 3
path matching 5860.546875
path matching NULL