From fa85adfe0bac66cfe52c413c5794d667ffb061d6 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Wed, 7 Jan 2015 15:02:32 +0100 Subject: [PATCH] =?UTF-8?q?DATAMONGO-1123=20-=20Improve=20JavaDoc=20of=20M?= =?UTF-8?q?ongoOperations.geoNear(=E2=80=A6).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The JavaDoc of the geoNear(…) methods in MongoOperations now contain a hint to MongoDB limiting the number of results by default and an explicit limit on the NearQuery can be used to disable that. --- .../data/mongodb/core/MongoOperations.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java index f48d6b128..e38912bfe 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2014 the original author or authors. + * Copyright 2011-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -415,7 +415,9 @@ public interface MongoOperations { /** * Returns {@link GeoResults} for all entities matching the given {@link NearQuery}. Will consider entity mapping - * information to determine the collection the query is ran against. + * information to determine the collection the query is ran against. Note, that MongoDB limits the number of results + * by default. Make sure to add an explicit limit to the {@link NearQuery} if you expect a particular number of + * results. * * @param near must not be {@literal null}. * @param entityClass must not be {@literal null}. @@ -424,7 +426,9 @@ public interface MongoOperations { GeoResults geoNear(NearQuery near, Class entityClass); /** - * Returns {@link GeoResults} for all entities matching the given {@link NearQuery}. + * Returns {@link GeoResults} for all entities matching the given {@link NearQuery}. Note, that MongoDB limits the + * number of results by default. Make sure to add an explicit limit to the {@link NearQuery} if you expect a + * particular number of results. * * @param near must not be {@literal null}. * @param entityClass must not be {@literal null}.