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"
Your syntax is wrong. Try this-
let $name1 := "Bob"
let $name2 := "John"
return
if (fn:contains($name1, "Bo")) then
"Bob is good"
else
"John is good"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With