Rediger

Del via


StringEquals (NoSQL query)

APPLIES TO: NoSQL

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

Syntax

StringEquals(<string_expr_1>, <string_expr_2> [, <boolean_expr>])  

Arguments

Description
string_expr_1 The first string expression to compare.
string_expr_2 The second string expression to compare.
boolean_expr (Optional) An optional boolean expression for ignoring case. When set to true, this function performs a case-insensitive search. If not specified, the default value is false.

Return types

Returns a boolean expression.

Examples

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

SELECT VALUE {
    compareSameCase: STRINGEQUALS("AdventureWorks", "AdventureWorks"),
    compareDifferentCase: STRINGEQUALS("AdventureWorks", "adventureworks"),
    compareIgnoreCase: STRINGEQUALS("AdventureWorks", "adventureworks", true)
}
[
  {
    "compareSameCase": true,
    "compareDifferentCase": false,
    "compareIgnoreCase": true
  }
]

Remarks

  • This function performs an index seek.