Module: Mongoid::Geo::Near
- Defined in:
- lib/mongoid/geo/geo_near.rb
Instance Method Summary collapse
- #geoNear(center, location_attribute, options = {}) ⇒ Object (also: #geo_near)
Instance Method Details
#geoNear(center, location_attribute, options = {}) ⇒ Object Also known as: geo_near
66 67 68 69 70 |
# File 'lib/mongoid/geo/geo_near.rb', line 66 def geoNear(center, location_attribute, = {}) center = center.respond_to?(:collection) ? eval("center.#{location_attribute}") : center query = create_query(self, center, ) create_result(query_result(self, query, center, location_attribute, )).extend(Mongoid::Geo::Models).as_criteria([:dist_order]) end |