Skip to content

Commit ea92b4f

Browse files
committed
Add StringEquals
1 parent cae63bc commit ea92b4f

File tree

1 file changed

+35
-47
lines changed

1 file changed

+35
-47
lines changed
Lines changed: 35 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,48 @@
11
---
2-
title: StringEquals in Azure Cosmos DB query language
3-
description: Learn about how the StringEquals SQL system function in Azure Cosmos DB returns a Boolean indicating whether the first string expression matches the second
4-
author: seesharprun
2+
title: StringEquals
3+
titleSuffix: Azure Cosmos DB for NoSQL
4+
description: An Azure Cosmos DB for NoSQL system function that returns a boolean indicating whether two strings are equivalent.
5+
author: jcodella
6+
ms.author: jacodel
7+
ms.reviewer: sidandrews
58
ms.service: cosmos-db
69
ms.subservice: nosql
7-
ms.topic: conceptual
8-
ms.date: 05/20/2020
9-
ms.author: sidandrews
10-
ms.reviewer: jucocchi
11-
ms.custom: query-reference, ignite-2022
10+
ms.topic: reference
11+
ms.date: 07/24/2023
12+
ms.custom: query-reference
1213
---
13-
# STRINGEQUALS (Azure Cosmos DB)
14+
15+
# StringEquals (NoSQL query)
16+
1417
[!INCLUDE[NoSQL](../../includes/appliesto-nosql.md)]
1518

16-
Returns a Boolean indicating whether the first string expression matches the second.
17-
19+
Returns a boolean indicating whether the first string expression matches the second.
20+
1821
## Syntax
19-
22+
2023
```sql
21-
STRINGEQUALS(<str_expr1>, <str_expr2> [, <bool_expr>])
22-
```
23-
24+
STRINGEQUALS(<string_expr_1>, <string_expr_2> [, <boolean_expr>])
25+
```
26+
2427
## Arguments
25-
26-
*str_expr1*
27-
Is the first string expression to compare.
28-
29-
*str_expr2*
30-
Is the second string expression to compare.
31-
32-
*bool_expr*
33-
Optional value for ignoring case. When set to true, StringEquals does a case-insensitive search. When unspecified, this value is false.
34-
28+
29+
| | Description |
30+
| --- | --- |
31+
| **`string_expr_1`** | The first string expression to compare. |
32+
| **`string_expr_2`** | The second string expression to compare. |
33+
| **`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`. |
34+
3535
## Return types
36-
37-
Returns a Boolean expression.
38-
36+
37+
Returns a boolean expression.
38+
3939
## Examples
40-
41-
The following example checks if "abc" matches "abc" and if "abc" matches "ABC."
42-
43-
```sql
44-
SELECT STRINGEQUALS("abc", "abc", false) AS c1, STRINGEQUALS("abc", "ABC", false) AS c2, STRINGEQUALS("abc", "ABC", true) AS c3
45-
```
46-
47-
Here's the result set.
48-
49-
```json
50-
[
51-
{
52-
"c1": true,
53-
"c2": false,
54-
"c3": true
55-
}
56-
]
57-
```
40+
41+
The following example checks if "abc" matches "abc" and if "abc" matches "ABC."
42+
43+
:::code language="sql" source="~/cosmos-db-nosql-query-samples/scripts/stringequals/query.sql" highlight="2-4":::
44+
45+
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/stringequals/result.json":::
5846

5947
## Remarks
6048

@@ -63,4 +51,4 @@ SELECT STRINGEQUALS("abc", "abc", false) AS c1, STRINGEQUALS("abc", "ABC", false
6351
## Next steps
6452

6553
- [System functions Azure Cosmos DB](system-functions.yml)
66-
- [Introduction to Azure Cosmos DB](../../introduction.md)
54+
- [`SUBSTRING`](substring.md)

0 commit comments

Comments
 (0)