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: docs/filtering.rst
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,10 @@ In this example, we want to retrieve people whose name is equal to their birth_d
44
44
45
45
If you want to filter through relationships you can do that:
46
46
47
-
.. sourcecode:: http
48
47
49
-
GET /user?filter=[
48
+
49
+
.. sourcecode:: json
50
+
[
50
51
{
51
52
"name": "group",
52
53
"op": "any",
@@ -56,7 +57,12 @@ If you want to filter through relationships you can do that:
56
57
"val": "%admin%"
57
58
}
58
59
}
59
-
] HTTP/1.1
60
+
]
61
+
62
+
63
+
.. sourcecode:: http
64
+
65
+
GET [{"name":"group","op":"any","val":{"name":"name","op":"ilike","val":"%admin%"}}] HTTP/1.1
60
66
Accept: application/vnd.api+json
61
67
62
68
.. note ::
@@ -72,9 +78,9 @@ There is a shortcut to achieve the same filtering:
72
78
73
79
You can also use boolean combination of operations:
74
80
75
-
.. sourcecode:: http
81
+
.. sourcecode:: json
76
82
77
-
GET /user?filter=[
83
+
[
78
84
{
79
85
"name":"group.name",
80
86
"op":"ilike",
@@ -105,7 +111,11 @@ You can also use boolean combination of operations:
105
111
}
106
112
]
107
113
}
108
-
] HTTP/1.1
114
+
]
115
+
116
+
.. sourcecode:: http
117
+
118
+
GET /user?filter=[{"name":"group.name","op":"ilike","val":"%admin%"},{"or":[{"not":{"name":"first_name","op":"eq","val":"John"}},{"and":[{"name":"first_name","op":"like","val":"%Jim%"},{"name":"date_create","op":"gt","val":"1990-01-01"}]}]}] HTTP/1.1
0 commit comments