-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Query with in() returns an empty RealmResults #6522
Comments
Are we talking about realm/realm-core#3250?
This is supposed to work. 😞 |
Although it says:
If the I was wondering if realm/realm-core#3271 is related, but it is for |
I should have mentioned my "uid" field is of type String, and not the Primary key in this given table |
It is also not marked with |
Correct |
@mick1418 Could you please make a minimal self-contained repro case? Or a PR with a test-case that shows this? |
Getting this issue as well. In my case the field is marked with Haven't been able to determine a use-case to make available. |
I cannot reproduce this with a unit test:
For neither integer nor String primary key |
I have near same problem. Where query return zero values, but simply loop show that values are here. Realm version(s): 5.11.0, 5.12.0
Result:
|
@cmelchior
5.10 Realm
Hope it helps :) |
@Quarx2k Thank you very much for this 👏 . I can reproduce the behavior and is looking into it. |
It seems to be a bug with Indexes. The error goes away if you remove Indexes. |
(you can't remove the index of a primary key field though) |
realm/realm-core#3320 should fix this. |
Realm Core 5.23.1 release should have the fix, now Realm-Java needs to update the Core version in next release 🤔 |
Fixed in 5.13.1 |
Goal
I want to query a table and retrieve objects by their IDS
Actual Results
The RealmResults returns an empty list, even if the objects are in the table (checked with Realm Studio).
Steps & Code to Reproduce
Requesting the table with multiples IDs always return an empty list, but querying the IDs separately returns a list with the object.
realm.where("mytable").equalTo("uid", "firstUID").findAll()
-> returns a list with the objectrealm.where("mytable").equalTo("uid", "secondUID").findAll()
-> returns a list with the objectrealm.where("mytable").beginGroup().equalTo("uid", "firstUID").or().equalTo("uid", "secondUID").endGroup().findAll()
-> returns an empty listrealm.where("mytable").in("uid", new String[]{"firstUID", "secondUID"}).findAll()
-> returns an empty listMaybe it has something to do with the following PR: (Realm Core PR #3250).
Reverting to 5.9.1 solved the issue.
Version of Realm and tooling
Realm version(s): ? 5.11.0
Realm Sync feature enabled: No
Android Studio version: ? 3.4 stable
Android Build Tools version: ? 28.0.3
Gradle version: ? 5.1.1
Which Android version and device(s): ? Android API 28, Emulator
The text was updated successfully, but these errors were encountered: