Hi I am using 4.0.0.beta1 and I cannot use geo_near as a scope:
class Moment include Mongoid::Document field :location, type: Array index({ location: "2dsphere" }, background: true) scope :near_by, lambda {|location, distance| geo_near(location).spherical.distance_multiplier(6371.39).max_distance(distance / 6371.39)} end
Moment.near_by([ 51.545099, -0.0106 ], 1.083).each {|a| p a}
NoMethodError: undefined method `to_criteria' for #<Mongoid::Contextual::GeoNear:0x007f84a71cb550>