I want to make look around feature in my app using geo_near i already make index on my model
...
field :location, Type: Array
index({ location: "2d" })
self.create_indexes
i already run
rake db:mongoid:create_indexes
here code i use in my controller
@merchants = Merchant.geo_near([coordinate.first.to_f, coordinate.last.to_f]).max_distance(50)
but i got error said :
Mongo::Error::OperationFailure (no such command: 'geoNear' (59) (on localhost:27017) (on localhost:27017)):
i using mongoid 7, ruby on rails 6.0.2, ruby 2.6.3, mongo 4.2.2
you can see full log trace here trace_log.txt