I need to filter a MarkLogic sequence (after the cts query) with javascript by checking the existence of an element. If the element exists, show the value. I know this is possible with XQuery by doing something like
fn:filter(function($a) { fn:not(fn:empty($a/es:envelope/es:instance/MyEntity/MyField)) }, $miseq)/es:envelope/es:instance/MyEntity/MyField
I didn't see an equivalent for Javascript. I know i can achieve this doing it manually with a for loop, but performance is significantly worse (not to mention is less pretty)
Any suggestion/s?
Thank you