I am trying this code on MarkLogic console and getting this error
Unexpected token syntax error, unexpected If_
Here is the code
let $name1 := "Bob"
let $name2 := "John"
if(fn:contains($name1, "Bo")) then
return "Bob is good"
else
return "John is good"
let
statements begin a FLWOR (let
is the L in a FLWOR). The conditional if/else block needs to be part of one of those components. Move the return outside of the if/else to create a fLwoR. en.wikipedia.org/wiki/FLWOR - Mads Hansen