objectbox / objectbox-java

Android Database - first and fast, lightweight on-device vector database
https://objectbox.io
Apache License 2.0
4.4k stars 302 forks source link

ObjectBrowser: not possible to add filter based on relation-ID #1057

Open ajans opened 2 years ago

ajans commented 2 years ago

:rotating_light: First, please check:

As far as I searched the open and closed issues with keyword "browser", I couldn't find anything related.

Curiously, I couldn't find anything in the docs about the ObjectBrowsers' usage and setup (aside of the changelog), is it deprecated now?

This page gives me a 500-code page right now...

The FAQ doesn't mention usage of the objectbrowser

Describe the bug If I try to filter the data in the objectbrowser for an Entity that is participating as a target in an ToMany-relation, the objectbrowser-filter feature does not let me choose any operators for the ID-property for the ToOne-backlink.

Basic info (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Extract the attached demo-project objectboxtest.zip
  2. Open the project in Android Studio
  3. Compile and start the app on an emulator or device
  4. Leave the app open
  5. On the terminal, execute command adb forward tcp:8090 tcp:8090
  6. On the desktop, open a browser and open objectbrowser at http://localhost:8090/#/data/Login/page-1
  7. Add a filter for the Login-table
  8. As the filtered property, select userId
  9. Try to select the operator, but only choice from the popup is No data available
  10. No dice!

Expected behavior As the property userId is a Long, I would expect the operator-popup to give me at least the choice to select = to filter the table for specific rows, so that I can filter a longer list of data for specific items.

Code If applicable, add code to help explain your problem.

objectboxtest.zip

Logs, stack traces If applicable, add relevant logs, or a stack trace.

There are no build-issues or runtime-errors to be observed. Even the objectbrowser does not issue any warnings at any time.

Additional context Add any other context about the problem here.

The only special thing about this might be the use-case for the filtering-feature in the objectbrowser. Otherwise, it is a very simple demo-setup according to the Get-Started-docs (aside from the objectbrowser-setup, which I had to derive from my real app-project, since I couldn't find any setup-docs for it anymore).

Nothing of the like is used here.

I tried the workaround mentioned here to being able to filter data with the userId in the objectbrowser, but sadly it didn't make any difference.

It would be really nice to be able to filter specific dependent data from relations in the objectbrowser, as long as a dedicated relations-browser feature is missing.

Thank you for your support!

ajans commented 2 years ago

The troubleshooting-page works again, but does not show anything of relevance for this issue.

greenrobot-team commented 2 years ago

Thanks for reporting. Actually, this would require a condition on a related entity (link query). This is AFAIK not currently supported in the Admin data browser.