Filter expression (Multi-Conditions) by HTTP REST API #5132
-
Version: PocketBase v0.22.13 Success Case: return 200 when using single field filter, like: Failure Case: return 400 when using multi-fields filter, like: Error Message: I am using pocketbase as app backend, so implemented api request with native Swift and Alamofire. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The easiest way to rule out PocketBase issue is to try the filter in the Admin UI. If you are constructing the request manually, the ?filter=title~%27abc%27%20%26%26%20created%3E%272022-01-01%27 Also note that the full-date time format is // adjust the date depending on your requirement
?filter=title~'abc' && created>='2022-01-01 00:00:00.000Z'
// url encoded version:
?filter=title~%27abc%27%20%26%26%20created%3E%3D%272022-01-01%2000%3A00%3A00.000Z%27 For more detailed error messages you could also start the executable with If the above doesn't help, please export your collections configuration as json (Admin UI > Settings > Export collections) and provide a minimal code sample how you are sending request. |
Beta Was this translation helpful? Give feedback.
The easiest way to rule out PocketBase issue is to try the filter in the Admin UI.
If you are constructing the request manually, the
filter
query parameter must be properly URL encoded, aka. in your case the valid query parameter should be:Also note that the full-date time format is
Y-m-d H:i:s.uZ
, so a more precise date constraint could be:For more detailed error messages you could also start the executable with
…