RealmQuery between problems with double datatype
See original GitHub issueI want to get data from Realm Cloud with between
filter 2 numbers. Previously I used long
type for date
column and It will return value if I query this:
long start = calendarStart.getTimeInMillis() / 1000;
long end = calendarEnd.getTimeInMillis() / 1000;
result = getRealmSyncInstance()
.where(MyClass.class)
// .greaterThanOrEqualTo("date", start)
// .lessThanOrEqualTo("date", end)
.between("date", start, end)
.sort("date", Sort.ASCENDING)
.findAllAsync();
Then I clear Realm Cloud and change local MyClass
date
, start, end from long
to double
. Then no result received.
I also use greaterThanOrEqualTo
and lessThanOrEqualTo
but no luck.
Seem like it only happens on realm cloud.
Version of Realm and tooling
Realm version(s): 5.0.0
Realm sync feature enabled: yes
Android Studio version: 3.1
Which Android version and device: Oreo
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Migrate realm field of type double to new sub-object with values
Something like this should work: RealmObjectSchema valueSchema = schema.create("Value") .addField("value", Integer.class) .
Read more >Realm Query Language - MongoDB
Realm Query Language (RQL) is a string-based query language to constrain searches when retrieving objects from a realm. SDK-specific methods pass queries to ......
Read more >Difference Between float vs double Data Types [Updated]
Float and double are primitive data types used by programming languages to store floating-point real (decimal) numbers like 10.923455, ...
Read more >Decimal vs Double in SQL - ObjectRocket
Postgresql supports a wide variety of native data types. Among them are text data types, numeric data types, date and times, Boolean data...
Read more >Create reactive mobile apps in a fraction of the time - Realm
Build the query looking at all users: RealmQuery<User> query = realm.where(User.class); // Add ... Not all conditions are applicable for all data types....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @kainjinez I was able to reproduce your issue, it looks like the Sync query parser failed to parse the mathematical notation
.lessThanOrEqualTo("value", 10_000_000d)
which result in1e+07
(full queryvalue >= 0 and value <= 1e+07 SORT(timestamp DESC)
). I’m investigating with the Core team to provide a fixclosing please follow progress in realm/realm-core#3076