Closed michaellinder1995 closed 4 months ago
Always
Example class in kotlin sdk:
class Workout : RealmObject { /** PROPERTIES */ @PrimaryKey var id: RealmUUID = RealmUUID.random() var created: RealmInstant? = RealmInstant.now() }
Example call (empty result):
val workouts = realm.query(Workout::class, query = “date < $0”, RealmInstant.now()).find()
Sadly i always get an empty result. No matter which direction of the comparison operator I'm using. I did’nt find anything in the documentation how to query Realminstant: https://www.mongodb.com/docs/realm/realm-query-language/ 1
Anyone knows how to create the query or what datatype i should use instead? Currently my workaround would be to query all and then do the filtering with standard Kotlin function. But performance sucks.
Hope anyone can help.
1.12.0
In the class, the field is called created while you use date in the query. Is that a typing mistake?
created
date
Oh shit :D
I had a second var var date: RealmInstant? = null
var date: RealmInstant? = null
That wasn't set. Thanks so much!
How frequently does the bug occur?
Always
Description
Example class in kotlin sdk:
class Workout : RealmObject { /** PROPERTIES */ @PrimaryKey var id: RealmUUID = RealmUUID.random() var created: RealmInstant? = RealmInstant.now() }
Example call (empty result):
val workouts = realm.query(Workout::class, query = “date < $0”, RealmInstant.now()).find()
Sadly i always get an empty result. No matter which direction of the comparison operator I'm using. I did’nt find anything in the documentation how to query Realminstant: https://www.mongodb.com/docs/realm/realm-query-language/ 1
Anyone knows how to create the query or what datatype i should use instead? Currently my workaround would be to query all and then do the filtering with standard Kotlin function. But performance sucks.
Hope anyone can help.
Version
1.12.0