Spring Data MongoDB
  1. Spring Data MongoDB
  2. DATAMONGO-603

Results of geo queries in repository dont't get metrics of supplied distance applied

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.2 GA
    • Component/s: None
    • Labels:
      None

      Description

      Assume you have a geo query in a repository:

      interface PersonRepository implements Repository<Person, Long> {
      
        GeoResults<Person> findByLocationNear(Point point, Distance distance);
      }
      

      Handing in a Distance in a particular metric is not regarded in the Distance instance the GeoResults instance carries in ….getAverageDistance().

      Distance distance = new Distance(150, Metrics.KILOMETERS);
      Point point = new Point(10.0, 20.0);
      
      GeoResults<Person> result = repository.findByLocationNear(point, distance);
      
      // fails
      assertThat(result.getAverageDistance().getMetric(), is(Metrics.KILOMETERS));
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Oliver Gierke
            Reporter:
            Oliver Gierke
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: