You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-web-pubsub/reference-odata-filter.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,13 @@ ms.date: 11/11/2022
10
10
11
11
# OData filter syntax in Azure Web PubSub service
12
12
13
-
In Azure Web PubSub service, the **filter** parameter specifies inclusion or exclusion criteria for the connections to send messages to. This article describes the OData syntax of **filter** and provides examples.
13
+
Azure Web PubSub's **filter** parameter defines inclusion or exclusion criteria for sending messages to connections.
14
14
15
-
The complete syntax is described in the [formal grammar](#formal-grammar).
15
+
This article provides the following:
16
16
17
-
There is also a browsable [syntax diagram](https://aka.ms/awps/filter-syntax-diagram) that allows you to interactively explore the grammar and the relationships between its rules.
17
+
- A description of the OData syntax of the **filter** parameter with examples.
18
+
- A [formal grammar](#formal-grammar) that describes the complete syntax.
19
+
- A browsable [syntax diagram](https://aka.ms/awps/filter-syntax-diagram) to let you interactively explore grammar rules.
An interactive syntax diagram is available at, [OData syntax diagram for Azure Web PubSub service](https://aka.ms/awps/filter-syntax-diagram).
39
41
40
-
> [!div class="nextstepaction"]
41
-
> [OData syntax diagram for Azure Web PubSub service](https://aka.ms/awps/filter-syntax-diagram)
42
-
43
-
> [!NOTE]
44
-
> See [formal grammar section](#formal-grammar) for the complete EBNF.
42
+
For the complete EBNF, see [formal grammar section](#formal-grammar) .
45
43
46
44
### Identifiers
47
45
48
-
The filter syntax is used to filter out the connections matching the filter expression to send messages to.
49
-
50
-
Azure Web PubSub supports below identifiers:
46
+
Using the filter syntax, you can control sending messages to connections matching the identifier criteria. Azure Web PubSub supports below identifiers:
51
47
52
48
| Identifier | Description | Note | Examples
53
49
| --- | --- | -- | --
54
50
| `userId` | The userId of the connection. | Case insensitive. It can be used in [string operations](#supported-operations). | `userId eq 'user1'`
55
51
| `connectionId` | The connectionId of the connection. | Case insensitive. It can be used in [string operations](#supported-operations). | `connectionId ne '123'`
56
52
| `groups` | The collection of groups the connection is currently in. | Case insensitive. It can be used in [collection operations](#supported-operations). | `'group1' in groups`
57
53
58
-
Identifiers are used to refer to the property value of a connection. Azure Web PubSub supports 3 identifiers matching the property name of the connection model. and supports identifiers `userId` and `connectionId` in string operations, supports identifier `groups` in [collection operations](#supported-operations). For example, to filter out connections with userId `user1`, we specify the filter as `userId eq 'user1'`. Read through the below sections for more samples using the filter.
54
+
Identifiers refer to the property value of a connection. Azure Web PubSub supports three identifiers matching the property name of the connection model. and supports identifiers `userId` and `connectionId` in string operations, supports identifier `groups` in [collection operations](#supported-operations). For example, to filter out connections with userId `user1`, we specify the filter as `userId eq 'user1'`. Read through the below sections for more samples using the filter.
59
55
60
56
### Boolean expressions
61
57
@@ -69,6 +65,9 @@ The types of Boolean expressions include:
69
65
- Boolean expressions in parentheses. Using parentheses can help to explicitly determine the order of operations in a filter. For more information on the default precedence of the OData operators, see [operator precedence section](#operator-precedence).
70
66
71
67
### Supported operations
68
+
69
+
The filter syntac supports the following operations:
70
+
72
71
| Operator | Description | Example
73
72
| --- | --- | ---
74
73
| **Logical Operators**
@@ -136,7 +135,7 @@ not (length(userId) gt 5)
136
135
137
136
### Filter size limitations
138
137
139
-
There are limits to the size and complexity of filter expressions that you can send to Azure Web PubSub service. The limits are based roughly on the number of clauses in your filter expression. A good guideline is that if you have over 100 clauses, you are at risk of exceeding the limit. We recommend designing your application in such a way that it doesn't generate filters of unbounded size.
138
+
There are limits to the size and complexity of filter expressions that you can send to Azure Web PubSub service. The limits are based roughly on the number of clauses in your filter expression. A good guideline is that if you have over 100 clauses, you are at risk of exceeding the limit. To avoid exceeding the limit, design your application so that it doesn't generate filters of unbounded size.
140
139
141
140
## Examples
142
141
@@ -164,7 +163,7 @@ There are limits to the size and complexity of filter expressions that you can s
164
163
165
164
## Formal grammar
166
165
167
-
We can describe the subset of the OData language supported by Azure Web PubSub service using an EBNF ([Extended Backus-Naur Form](https://en.wikipedia.org/wiki/Extended_Backus–Naur_form)) grammar. Rules are listed "top-down", starting with the most complex expressions, and breaking them down into more primitive expressions. At the top is the grammar rule for `$filter` that correspond to specific parameter `filter` of the Azure Azure Web PubSub service `Send*` REST APIs:
166
+
We can describe the subset of the OData language supported by Azure Web PubSub service using an EBNF ([Extended Backus-Naur Form](https://en.wikipedia.org/wiki/Extended_Backus–Naur_form)) grammar. Rules are listed "top-down", starting with the most complex expressions, then breaking them down into more primitive expressions. At the top is the grammar rule for `$filter` that corresponds to specific parameter `filter` of the Azure Azure Web PubSub service `Send*` REST APIs:
0 commit comments