@@ -807,19 +807,24 @@ <T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName, Strin
807807 <T > List <T > find (Query query , Class <T > entityClass , String collectionName );
808808
809809 /**
810- * Query for a window window of objects of type T from the specified collection. <br />
810+ * Query for a window of objects of type T from the specified collection. <br />
811811 * Make sure to either set {@link Query#skip(long)} or {@link Query#with(KeysetScrollPosition)} along with
812812 * {@link Query#limit(int)} to limit large query results for efficient scrolling. <br />
813813 * Result objects are converted from the MongoDB native representation using an instance of {@see MongoConverter}.
814814 * Unless configured otherwise, an instance of {@link MappingMongoConverter} will be used. <br />
815815 * If your collection does not contain a homogeneous collection of types, this operation will not be an efficient way
816816 * to map objects since the test for class type is done in the client and not on the server.
817+ * <p>
818+ * When using {@link KeysetScrollPosition}, make sure to use non-nullable {@link org.springframework.data.domain.Sort
819+ * sort properties} as MongoDB does not support criteria to reconstruct a query result from absent document fields or
820+ * {@code null} values through {@code $gt/$lt} operators.
817821 *
818822 * @param query the query class that specifies the criteria used to find a record and also an optional fields
819823 * specification. Must not be {@literal null}.
820824 * @param entityType the parametrized type of the returned window.
821825 * @return the converted window.
822- * @throws IllegalStateException if a potential {@link Query#getKeyset() KeysetScrollPosition} contains an invalid position.
826+ * @throws IllegalStateException if a potential {@link Query#getKeyset() KeysetScrollPosition} contains an invalid
827+ * position.
823828 * @since 4.1
824829 * @see Query#with(org.springframework.data.domain.OffsetScrollPosition)
825830 * @see Query#with(org.springframework.data.domain.KeysetScrollPosition)
@@ -834,13 +839,18 @@ <T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName, Strin
834839 * Unless configured otherwise, an instance of {@link MappingMongoConverter} will be used. <br />
835840 * If your collection does not contain a homogeneous collection of types, this operation will not be an efficient way
836841 * to map objects since the test for class type is done in the client and not on the server.
842+ * <p>
843+ * When using {@link KeysetScrollPosition}, make sure to use non-nullable {@link org.springframework.data.domain.Sort
844+ * sort properties} as MongoDB does not support criteria to reconstruct a query result from absent document fields or
845+ * {@code null} values through {@code $gt/$lt} operators.
837846 *
838847 * @param query the query class that specifies the criteria used to find a record and also an optional fields
839848 * specification. Must not be {@literal null}.
840849 * @param entityType the parametrized type of the returned window.
841850 * @param collectionName name of the collection to retrieve the objects from.
842851 * @return the converted window.
843- * @throws IllegalStateException if a potential {@link Query#getKeyset() KeysetScrollPosition} contains an invalid position.
852+ * @throws IllegalStateException if a potential {@link Query#getKeyset() KeysetScrollPosition} contains an invalid
853+ * position.
844854 * @since 4.1
845855 * @see Query#with(org.springframework.data.domain.OffsetScrollPosition)
846856 * @see Query#with(org.springframework.data.domain.KeysetScrollPosition)
0 commit comments