-
Notifications
You must be signed in to change notification settings - Fork 137
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
Searching for devices using jsonFilter does not seem to work for string values #3643
Comments
Can you reproduce this with a local installation using the JDBC registry with PostgreSQL? The integration tests of Hono include a test case that verifies searching by (nested) string-typed fields, but the embedded H2 based JDBC registry that is used on the Sandbox seems to have problems with this and sorting ... |
I have reproduced this issue running on a fresh installation to my docker-desktop embedded k8s cluster. That setup has a PSQL DB underneath the JDBC based device registry. I'm seeing this behavior there as well. |
Can you create a verifier (test case) for it? |
According to the documentation, searching for devices can be done using a predicate specified by the
filterJson
request parameter. The example in the documentation for example is{"field": "/ext/brand","value": "eclipse*"}
indicating that searching in nested fields should be supported.However, it seems that it is not as demonstrated by the following example run against the Hono sandbox setup.
First we'll get a list of the devices that are registered on the
DEFAULT_TENANT
:Here we see that there is a device registered that we can try searching for by filtering on the value of
/ext/ep
:If we perform a GET request using
{"field": "/ext/ep","value": "IMEI4711"}
as thejsonFilter
value, we see that no device is returned:When trying to search by the
/id
field using thejsonFilter
value of{"field": "/id","value": "1234"}
, that does not work either:However, if we search for devices that have the
enabled
field set to atrue
value, that seems to work as we only get the subset of devices that actually have that set:Note that we're only getting 3 devices with this query while we got 5 devices with our original query (using no
jsonFilter
).So my gut feeling is that this must be a bug.
The text was updated successfully, but these errors were encountered: