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
| Conditional logical OR |`or`|`?filter=or(has(orders),has(invoices))`|
29
30
| Conditional logical AND |`and`|`?filter=and(has(orders),has(invoices))`|
@@ -86,6 +87,31 @@ GET /customers?filter=has(orders,not(equals(status,'Paid'))) HTTP/1.1
86
87
87
88
Which returns only customers that have at least one unpaid order.
88
89
90
+
_since v5.0_
91
+
92
+
Use the `isType` filter function to perform a type check on a derived type. You can pass a nested filter, where the derived fields are accessible.
93
+
The first parameter can be used to perform the type check on a to-one relationship path.
94
+
95
+
Only return men:
96
+
```http
97
+
GET /humans?filter=isType(,men) HTTP/1.1
98
+
```
99
+
100
+
Only return men with beards:
101
+
```http
102
+
GET /humans?filter=isType(,men,equals(hasBeard,'true')) HTTP/1.1
103
+
```
104
+
105
+
Only return people whose best friend is a man with children:
106
+
```http
107
+
GET /humans?filter=isType(bestFriend,men,has(children)) HTTP/1.1
108
+
```
109
+
110
+
Only return people who have at least one female married child:
111
+
```http
112
+
GET /humans?filter=has(children,isType(,woman,not(equals(husband,null)))) HTTP/1.1
113
+
```
114
+
89
115
# Legacy filters
90
116
91
117
The next section describes how filtering worked in versions prior to v4.0. They are always applied on the set of resources being requested (no nesting).
0 commit comments