@@ -807,19 +807,24 @@ <T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName, Strin
807
807
<T > List <T > find (Query query , Class <T > entityClass , String collectionName );
808
808
809
809
/**
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 />
811
811
* Make sure to either set {@link Query#skip(long)} or {@link Query#with(KeysetScrollPosition)} along with
812
812
* {@link Query#limit(int)} to limit large query results for efficient scrolling. <br />
813
813
* Result objects are converted from the MongoDB native representation using an instance of {@see MongoConverter}.
814
814
* Unless configured otherwise, an instance of {@link MappingMongoConverter} will be used. <br />
815
815
* If your collection does not contain a homogeneous collection of types, this operation will not be an efficient way
816
816
* 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.
817
821
*
818
822
* @param query the query class that specifies the criteria used to find a record and also an optional fields
819
823
* specification. Must not be {@literal null}.
820
824
* @param entityType the parametrized type of the returned window.
821
825
* @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.
823
828
* @since 4.1
824
829
* @see Query#with(org.springframework.data.domain.OffsetScrollPosition)
825
830
* @see Query#with(org.springframework.data.domain.KeysetScrollPosition)
@@ -834,13 +839,18 @@ <T> MapReduceResults<T> mapReduce(Query query, String inputCollectionName, Strin
834
839
* Unless configured otherwise, an instance of {@link MappingMongoConverter} will be used. <br />
835
840
* If your collection does not contain a homogeneous collection of types, this operation will not be an efficient way
836
841
* 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.
837
846
*
838
847
* @param query the query class that specifies the criteria used to find a record and also an optional fields
839
848
* specification. Must not be {@literal null}.
840
849
* @param entityType the parametrized type of the returned window.
841
850
* @param collectionName name of the collection to retrieve the objects from.
842
851
* @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.
844
854
* @since 4.1
845
855
* @see Query#with(org.springframework.data.domain.OffsetScrollPosition)
846
856
* @see Query#with(org.springframework.data.domain.KeysetScrollPosition)
0 commit comments