Description
We're using mongo vie spring data and everything else seems to working aok except one geo-query. We're trying to run a bounding box query and sort it so that we only get 50 newest records. For some reason, if we don't specify $sort, all of the coordinates will be in a same very small area. I assume that Query query = new Query(where("loc").within(searchbox)) is sorting the results by distance? Then if we specify the sort-object like query.with(new Sort(Sort.Direction.ASC, "another")) the query will be slowest of the slow. We've created a combound index for that query.
Could someone please help?