Comments (4)
@jd565 Thank you for taking the time to report.
@ironage Do you have any ideas?
from realm-java.
Hi @jd565
Assuming 3 objects with member_ids of 100, 101, 102 then we'd expect the following matches for these queries:
query | result objects by member_id |
---|---|
member_id == NONE {100, 101, 102} |
no results |
member_id == NONE {100, 101} |
102 |
member_id == NONE {100} |
101, 102 |
member_id == ANY {100, 101, 102} |
100, 101, 102 |
member_id == ANY {100, 101} |
100, 101 |
member_id == ANY {100} |
100 |
We can read member_id == NONE {100, 101, 102}
as "match all members who have a member_id that equals none of {100, 101, 102}".
From your expectations, I think you are looking to use the ANY query instead of NONE. Let me know if that works for you.
from realm-java.
@ironage Thanks for taking a look.
The table above is not the behaviour I am seeing.
I am inserting 100, 101 and 102 ids into the table, then have this code in a test:
val nonMatching = realm.where<RealmProfile>()
.rawPredicate("${RealmProfile.MEMBER_ID} == NONE {100}")
.findAll()
.map { it.memberID }
assertEquals(listOf(101, 102), nonMatching)
that is, I want to find all the profiles without member id 100, expecting this to return just the members with id 101 and 102, but my test fails with the following:
java.lang.AssertionError: expected:<[101, 102]> but was:<[100]>
Suggesting that the raw predicate is not doing what you have outlined in your message above.
If I have multiple items inside the NONE, like NONE {100, 101}
, then the query correctly returns only member 102, so it seems to only be a problem when a single element is inside the NONE query
from realm-java.
@jd565 thanks for the clarification. I wasn't able to reproduce, until I add an index to test property (this applies to you if member_id is a primary key or if you have added an index manually). I submitted a fix in realm/realm-core#7333, but until that lands, I'd suggest that you change your query to be member_id != ALL {...}
which should produce equivalent results for the time being. Thanks for reporting this bug to us!
from realm-java.
Related Issues (20)
- Fix JavaDoc not being uploaded correctly
- Not Receiving Object Updates HOT 2
- Internal crash on OsJavaNetworkTransport.cpp HOT 5
- Required SETTINGS preface not received HOT 5
- Reduce SO source file size HOT 1
- * What went wrong: Execution failed for task ':ERemittance:kaptDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction > java.lang.reflect.InvocationTargetException (no error message) HOT 2
- Update to Core 13.26.0 or later HOT 2
- Devise public API to trigger client reset for a Realm file
- baseUrl Change
- May I ask which example would be better for Android Java project reference? HOT 2
- Model cannot be cast to ModelRealmProxyInterface while using realm jars built from source in Android Project HOT 6
- [realm-core-12.3.0] Assertion failed: false HOT 3
- io.realm.exceptions.RealmFileException HOT 5
- Realm Transformer Output Missing During Android Instrumented Test HOT 3
- Realm.Init configuration take too long delay when move intent from 1st page into next page HOT 3
- Realm not opening when offline HOT 7
- Custom machines ignore some cpu architectures HOT 2
- RealmList is null in Java17 HOT 2
- SDKs should not consume stitch_ prefixed fields HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realm-java.