Cast Long to String

I'm getting errors "cannot convert MethodHandle(Longs)long to (Object)String"

with this scripts:

doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + (String)doc['res.status'].value
String s = (String)doc['res.status'].value;
return doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + s
String s = doc['res.status'].value;
return doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + s

req.method and req.path are Strings, res.status is a Long


note:

doc['req.method'].value + ' ' + doc['req.path'].value + ' ' + doc['res.status'].value

just silently fails and returns empty value

apparently naming my scripted field with a starting _ was the issue

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.