fn:compare( $comparand1 as xs:string?, $comparand2 as xs:string?, [$collation as xs:string] ) as xs:integer?
Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
fn:compare("hello", "goodbye") => 1
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.