Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-1123

geoNear, does not return all matching elements, it returns only a max of 100 documents

    XMLWordPrintable

    Details

      Description

      Aloha,

      I have the following query:

      public GeoResults<MyObject> findByTypeAndLocationNear(MyObjectType type, Point p, Distance distance) {
         final NearQuery nearQuery = NearQuery.near(p).maxDistance(distance);
         log.info("{}",nearQuery.toDBObject());
         return mongoTemplate.geoNear(nearQuery, MyObject.class);
      }
      

      The geoNear method is documented like this:

      Returns {@link GeoResults} for all entities matching the given {@link NearQuery}.
      

      I expect 1000 "matching" documents But i only get 100. There is some default being set, that restricts the result to 100. That should be stated in the method. And another method having a pageable should be added.

      What do you think?

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            okr2014 Olaf Krische
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: