@@ -746,6 +746,7 @@ public Mono<Boolean> collectionExists(String collectionName) {
746
746
public <T > Mono <Void > dropCollection (Class <T > entityClass ) {
747
747
return dropCollection (getCollectionName (entityClass ));
748
748
}
749
+
749
750
@ Override
750
751
public Mono <Void > dropCollection (String collectionName ) {
751
752
@@ -884,7 +885,7 @@ <T> Mono<Window<T>> doScroll(Query query, Class<?> sourceClass, Class<T> targetC
884
885
Assert .notNull (targetClass , "Target type must not be null" );
885
886
886
887
EntityProjection <T , ?> projection = operations .introspectProjection (targetClass , sourceClass );
887
- ProjectingReadCallback <?,T > callback = new ProjectingReadCallback <>(mongoConverter , projection , collectionName );
888
+ ProjectingReadCallback <?, T > callback = new ProjectingReadCallback <>(mongoConverter , projection , collectionName );
888
889
int limit = query .isLimited () ? query .getLimit () + 1 : Integer .MAX_VALUE ;
889
890
890
891
if (query .hasKeyset ()) {
@@ -894,7 +895,8 @@ <T> Mono<Window<T>> doScroll(Query query, Class<?> sourceClass, Class<T> targetC
894
895
895
896
Mono <List <T >> result = doFind (collectionName , ReactiveCollectionPreparerDelegate .of (query ),
896
897
keysetPaginationQuery .query (), keysetPaginationQuery .fields (), sourceClass ,
897
- new QueryFindPublisherPreparer (query , keysetPaginationQuery .sort (), limit , 0 , sourceClass ), callback ).collectList ();
898
+ new QueryFindPublisherPreparer (query , keysetPaginationQuery .sort (), limit , 0 , sourceClass ), callback )
899
+ .collectList ();
898
900
899
901
return result .map (it -> ScrollUtils .createWindow (query , it , sourceClass , operations ));
900
902
}
@@ -1976,11 +1978,12 @@ public <T> Mono<UpdateResult> replace(Query query, T replacement, ReplaceOptions
1976
1978
return replace (query , (Class <T >) ClassUtils .getUserClass (replacement ), replacement , options , collectionName );
1977
1979
}
1978
1980
1979
- protected <S ,T > Mono <UpdateResult > replace (Query query , Class <S > entityType , T replacement , ReplaceOptions options ,
1981
+ protected <S , T > Mono <UpdateResult > replace (Query query , Class <S > entityType , T replacement , ReplaceOptions options ,
1980
1982
String collectionName ) {
1981
1983
1982
1984
MongoPersistentEntity <?> entity = mappingContext .getPersistentEntity (entityType );
1983
- UpdateContext updateContext = queryOperations .replaceSingleContext (query , operations .forEntity (replacement ).toMappedDocument (this .mongoConverter ), options .isUpsert ());
1985
+ UpdateContext updateContext = queryOperations .replaceSingleContext (query ,
1986
+ operations .forEntity (replacement ).toMappedDocument (this .mongoConverter ), options .isUpsert ());
1984
1987
1985
1988
return createMono (collectionName , collection -> {
1986
1989
@@ -1991,9 +1994,10 @@ protected <S,T> Mono<UpdateResult> replace(Query query, Class<S> entityType, T r
1991
1994
1992
1995
MongoCollection <Document > collectionToUse = createCollectionPreparer (query , action ).prepare (collection );
1993
1996
1994
- return collectionToUse .replaceOne (updateContext .getMappedQuery (entity ), mappedUpdate , updateContext .getReplaceOptions (entityType , it -> {
1995
- it .upsert (options .isUpsert ());
1996
- }));
1997
+ return collectionToUse .replaceOne (updateContext .getMappedQuery (entity ), mappedUpdate ,
1998
+ updateContext .getReplaceOptions (entityType , it -> {
1999
+ it .upsert (options .isUpsert ());
2000
+ }));
1997
2001
});
1998
2002
}
1999
2003
@@ -2050,8 +2054,8 @@ public <T> Flux<ChangeStreamEvent<T>> changeStream(@Nullable String database, @N
2050
2054
publisher = options .getCollation ().map (Collation ::toMongoCollation ).map (publisher ::collation )
2051
2055
.orElse (publisher );
2052
2056
publisher = options .getResumeBsonTimestamp ().map (publisher ::startAtOperationTime ).orElse (publisher );
2053
-
2054
- if (options .getFullDocumentBeforeChangeLookup ().isPresent ()) {
2057
+
2058
+ if (options .getFullDocumentBeforeChangeLookup ().isPresent ()) {
2055
2059
publisher = publisher .fullDocumentBeforeChange (options .getFullDocumentBeforeChangeLookup ().get ());
2056
2060
}
2057
2061
return publisher .fullDocument (options .getFullDocumentLookup ().orElse (fullDocument ));
@@ -2675,7 +2679,7 @@ private WriteConcern potentiallyForceAcknowledgedWrite(@Nullable WriteConcern wc
2675
2679
2676
2680
if (ObjectUtils .nullSafeEquals (WriteResultChecking .EXCEPTION , writeResultChecking )) {
2677
2681
if (wc == null || wc .getWObject () == null
2678
- || (wc .getWObject () instanceof Number concern && concern .intValue () < 1 )) {
2682
+ || (wc .getWObject ()instanceof Number concern && concern .intValue () < 1 )) {
2679
2683
return WriteConcern .ACKNOWLEDGED ;
2680
2684
}
2681
2685
}
@@ -3253,8 +3257,7 @@ public FindPublisher<Document> prepare(FindPublisher<Document> findPublisher) {
3253
3257
3254
3258
HintFunction hintFunction = HintFunction .from (query .getHint ());
3255
3259
Meta meta = query .getMeta ();
3256
- if (skip <= 0 && limit <= 0 && ObjectUtils .isEmpty (sortObject ) && hintFunction .isEmpty ()
3257
- && !meta .hasValues ()) {
3260
+ if (skip <= 0 && limit <= 0 && ObjectUtils .isEmpty (sortObject ) && hintFunction .isEmpty () && !meta .hasValues ()) {
3258
3261
return findPublisherToUse ;
3259
3262
}
3260
3263
0 commit comments