siuying / NanoStoreInMotion

RubyMotion wrapper for NanoStore, a lightweight schema-less key-value document database based on sqlite.
Other
103 stars 24 forks source link

Find returns no records #38

Closed TheRealNeil closed 9 years ago

TheRealNeil commented 9 years ago

Hi, I have a model with Latitude and Longitude fields. I am trying to find records by Latitude or Longitude but find does not return any results even though the record exists. Example: @user_location = UserLocation.find(:latitude => 37.33233141).first

Can anyone offer some advice?

Thanks, Neil

siuying commented 9 years ago

If you can query other values but not numbers like latitude, it might be because floating number are approximate and not stored as their exact values. In NanoStore you can create a predicate by searching for a small range. There is no such interface in NanoStoreInMotion, so you might need to dig in and add these feature if you need it.