-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter where not working for phone number format string "+000000000" #3621
Comments
What database do you use? |
mongodb |
Is the phone number defined as |
Yes, it is, and is required. |
Try request with Regex Operator Example: Root cause: CMIIW |
@UnclePetros, does the above comment from @warmansuganda help resolving your issue? |
I believe that a raw What happens when you invoke the controller method from JavaScript directly, e.g. from a test? |
I've tried. Unfortunately, not. |
Ok. If I remove the plus char in the phone field in document in db, and remove the plus char in the api call filter, data is retrieved correctly. Moreover, if I try to use the loopback explorer to do the query, it doesn't seems to work properly. About the special characters: I believe if I can store informations containing a special char, I should have the possibility to look for them. Thank you. |
Thank you for the clarification, @UnclePetros. It's important to know that you are using MongoDB, the behavior may be specific to this database.
Here is an experiment you can try yourself:
As you can see, Node.js is converting the plus character
You need to URL-encode values in your query, for example by calling
Here is a URL you can try from Postman:
At minimum, you need to replace
That's a known limitation of swagger-ui, the library we use in API Explorer. See #2208. It's very annoying and unfortunately also difficult to fix :( |
I am closing the issue as resolved. Feel free to re-open it if url-encoding your |
I had the same problem when filtering fields containing plus characters. @bajtos thanks for the solution. However, there is a mistake in proposed replacement. Correct replacement for Here is my line to replace multiple plus characters:
|
Steps to reproduce
Current Behavior
No data is returned.
If I remove the plus char from the field, filter works fine.
Expected Behavior
Document data is retrieved
The text was updated successfully, but these errors were encountered: