GeoJsonPoint point = new GeoJsonPoint(78.850300, 35.732700);
Query query = new Query(); query.addCriteria(Criteria.where(FIELD_LOCATION_LONGLAT).near(point).minDistance(0.0).maxDistance(10000.0));
mongoTemplate.forTenant(mcsRequest.getCustomer()).find(query, DBTower.class, TOWERS_COLLECTION);
mongoTemplate.forTenant(mcsRequest.getCustomer()).count(query, DBTower.class, TOWERS_COLLECTION);
The find works, but the count gets this error
org.springframework.data.mongodb.UncategorizedMongoDbException: Command failed with error 2 (BadValue): 'Point must only contain numeric elements' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Point must only contain numeric elements", "code": 2, "codeName": "BadValue"}; nested exception is com.mongodb.MongoCommandException: Command failed with error 2 (BadValue): 'Point must only contain numeric elements' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Point must only contain numeric elements", "code": 2, "codeName": "BadValue"}
I notice that the CountQuery class is turning my $near query to a $geoWithin, it didnt do that before.