ruby - Using $geoWithin issue mongoid -



ruby - Using $geoWithin issue mongoid -

any means built out in mongoid utilize $geowithin without storing in db?

wanting able utilize $geowithin (or similar method) calling on object has coordinates , subsequently passing polygonal boundaries.

thoughts?

have used geo_near?

this worked me

center = [lat.to_f, lon.to_f] user.geo_near(center).max_distance(10)

user model definition:

field :location, type:array # [lat,lng] index( { location: "2d" }, { min: -180, max: 180 })

ruby mongodb nosql mongoid

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -