realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.32k stars 2.15k forks source link

Support for arbitrary math expressions in queries #2489

Open ronjumola opened 9 years ago

ronjumola commented 9 years ago

Hi!

Thank you very much for checking my question.

I would like to ask if it is possible to use Math Functions in filtering the RealmResults?

Basically I would like to find a list of nearby records from a geolocation point.

I'd love to hear from you soon.

Thank you!

segiddins commented 9 years ago

@ronjumola at the moment, there's no way to use arbitrary math expressions in your queries, but @bdash was working on adding support for bounding box geo queries recently, I believe there's an open PR for that (https://github.com/realm/realm-cocoa/pull/2199).

CrystalRanita commented 8 years ago

@segiddins Will math expression supported in Realm.js, too?

As following expression: String where = "(" + MyDataColumns.TIME + "+ (" + MyData.OFFSET + " * 30" + "))" + "<=" + my_value;

Thanks,

jpsim commented 8 years ago

@CrystalRanita you're probably looking for the realm-js repo, though the answer at the moment is still no, since this is blocked on Realm's core engine shared by both this product (Realm Objective-C and Swift) as well as Realm React Native.