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
Post a Comment