23
23
import java .util .stream .Stream ;
24
24
25
25
import org .bson .Document ;
26
+ import org .springframework .data .domain .CursorRequest ;
27
+ import org .springframework .data .domain .CursorWindow ;
26
28
import org .springframework .data .geo .GeoResults ;
27
29
import org .springframework .data .mongodb .core .BulkOperations .BulkMode ;
28
30
import org .springframework .data .mongodb .core .aggregation .Aggregation ;
@@ -319,7 +321,8 @@ default MongoCollection<Document> createView(String name, Class<?> source, Aggre
319
321
* @param options additional settings to apply when creating the view. Can be {@literal null}.
320
322
* @since 4.0
321
323
*/
322
- MongoCollection <Document > createView (String name , Class <?> source , AggregationPipeline pipeline , @ Nullable ViewOptions options );
324
+ MongoCollection <Document > createView (String name , Class <?> source , AggregationPipeline pipeline ,
325
+ @ Nullable ViewOptions options );
323
326
324
327
/**
325
328
* Create a view with the provided name. The view content is defined by the {@link AggregationPipeline pipeline} on
@@ -331,7 +334,8 @@ default MongoCollection<Document> createView(String name, Class<?> source, Aggre
331
334
* @param options additional settings to apply when creating the view. Can be {@literal null}.
332
335
* @since 4.0
333
336
*/
334
- MongoCollection <Document > createView (String name , String source , AggregationPipeline pipeline , @ Nullable ViewOptions options );
337
+ MongoCollection <Document > createView (String name , String source , AggregationPipeline pipeline ,
338
+ @ Nullable ViewOptions options );
335
339
336
340
/**
337
341
* A set of collection names.
@@ -466,6 +470,38 @@ default MongoCollection<Document> createView(String name, Class<?> source, Aggre
466
470
*/
467
471
<T > List <T > findAll (Class <T > entityClass , String collectionName );
468
472
473
+ /**
474
+ * Query for a cursor window of objects of type T from the specified collection. <br />
475
+ * The object is converted from the MongoDB native representation using an instance of {@see MongoConverter}. Unless
476
+ * configured otherwise, an instance of {@link MappingMongoConverter} will be used. <br />
477
+ * If your collection does not contain a homogeneous collection of types, this operation will not be an efficient way
478
+ * to map objects since the test for class type is done in the client and not on the server.
479
+ *
480
+ * @param cursorRequest the cursor request.
481
+ * @param entityType the parametrized type of the returned list.
482
+ * @param collectionName name of the collection to retrieve the objects from.
483
+ * @return the converted cursor window.
484
+ * @see org.springframework.data.domain.OffsetCursorRequest
485
+ * @see org.springframework.data.domain.KeysetCursorRequest
486
+ */
487
+ <T > CursorWindow <T > findWindow (CursorRequest cursorRequest , Query query , Class <T > entityTypee );
488
+
489
+ /**
490
+ * Query for a cursor window of objects of type T from the specified collection. <br />
491
+ * The object is converted from the MongoDB native representation using an instance of {@see MongoConverter}. Unless
492
+ * configured otherwise, an instance of {@link MappingMongoConverter} will be used. <br />
493
+ * If your collection does not contain a homogeneous collection of types, this operation will not be an efficient way
494
+ * to map objects since the test for class type is done in the client and not on the server.
495
+ *
496
+ * @param cursorRequest the cursor request.
497
+ * @param entityType the parametrized type of the returned list.
498
+ * @param collectionName name of the collection to retrieve the objects from.
499
+ * @return the converted cursor window.
500
+ * @see org.springframework.data.domain.OffsetCursorRequest
501
+ * @see org.springframework.data.domain.KeysetCursorRequest
502
+ */
503
+ <T > CursorWindow <T > findWindow (CursorRequest cursorRequest , Query query , Class <T > entityType , String collectionName );
504
+
469
505
/**
470
506
* Execute an aggregation operation. The raw results will be mapped to the given entity class. The name of the
471
507
* inputCollection is derived from the inputType of the aggregation.
@@ -1175,7 +1211,7 @@ <S, T> T findAndReplace(Query query, S replacement, FindAndReplaceOptions option
1175
1211
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
1176
1212
* @return the count of matching documents.
1177
1213
* @throws org.springframework.data.mapping.MappingException if the collection name cannot be
1178
- * {@link #getCollectionName(Class) derived} from the given type.
1214
+ * {@link #getCollectionName(Class) derived} from the given type.
1179
1215
* @see #exactCount(Query, Class)
1180
1216
* @see #estimatedCount(Class)
1181
1217
*/
0 commit comments