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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -