I have started moveing old project from mongoid 4 to mongoid 5. The project is using geospatial search with additional fts search of returned results. The query looks like this:
docs = Adress.collection.aggregate( {"$geoNear" => {'near' => @coordinates, 'maxDistance' => 0.2, 'distanceField' => 'distance', 'limit' => 10000 }}, {"$match" => { 'fts' => { "$regex" => /#{@isci}/}} }, {"$limit" => 10 } ).to_a
I have found out that aggregate syntax has changed and that parameters are now passed as array, but then all kind of other errors appear.
Can you please help me how to define this query in mongoid 5, since documentation and examples are almost nonexisting.
Thanks
Damjan Rems