STRINGEQUALS (Azure Cosmos DB)

APPLIES TO: NoSQL

Returns a Boolean indicating whether the first string expression matches the second.

Syntax

STRINGEQUALS(<str_expr1>, <str_expr2> [, <bool_expr>])  

Arguments

str_expr1
Is the first string expression to compare.

str_expr2
Is the second string expression to compare.

bool_expr Optional value for ignoring case. When set to true, StringEquals will do a case-insensitive search. When unspecified, this value is false.

Return types

Returns a Boolean expression.

Examples

The following example checks if "abc" matches "abc" and if "abc" matches "ABC".

SELECT STRINGEQUALS("abc", "abc", false) AS c1, STRINGEQUALS("abc", "ABC", false) AS c2,  STRINGEQUALS("abc", "ABC", true) AS c3

Here is the result set.

[
    {
        "c1": true,
        "c2": false,
        "c3": true
    }
]

Remarks

Learn about how this string system function uses the index.

Next steps