|
|
|
@ -736,6 +736,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati |
|
|
|
public <T> Mono<Void> dropCollection(Class<T> entityClass) { |
|
|
|
public <T> Mono<Void> dropCollection(Class<T> entityClass) { |
|
|
|
return dropCollection(getCollectionName(entityClass)); |
|
|
|
return dropCollection(getCollectionName(entityClass)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Mono<Void> dropCollection(String collectionName) { |
|
|
|
public Mono<Void> dropCollection(String collectionName) { |
|
|
|
|
|
|
|
|
|
|
|
@ -874,7 +875,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati |
|
|
|
Assert.notNull(targetClass, "Target type must not be null"); |
|
|
|
Assert.notNull(targetClass, "Target type must not be null"); |
|
|
|
|
|
|
|
|
|
|
|
EntityProjection<T, ?> projection = operations.introspectProjection(targetClass, sourceClass); |
|
|
|
EntityProjection<T, ?> projection = operations.introspectProjection(targetClass, sourceClass); |
|
|
|
ProjectingReadCallback<?,T> callback = new ProjectingReadCallback<>(mongoConverter, projection, collectionName); |
|
|
|
ProjectingReadCallback<?, T> callback = new ProjectingReadCallback<>(mongoConverter, projection, collectionName); |
|
|
|
int limit = query.isLimited() ? query.getLimit() + 1 : Integer.MAX_VALUE; |
|
|
|
int limit = query.isLimited() ? query.getLimit() + 1 : Integer.MAX_VALUE; |
|
|
|
|
|
|
|
|
|
|
|
if (query.hasKeyset()) { |
|
|
|
if (query.hasKeyset()) { |
|
|
|
@ -884,7 +885,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati |
|
|
|
|
|
|
|
|
|
|
|
Mono<List<T>> result = doFind(collectionName, ReactiveCollectionPreparerDelegate.of(query), |
|
|
|
Mono<List<T>> result = doFind(collectionName, ReactiveCollectionPreparerDelegate.of(query), |
|
|
|
keysetPaginationQuery.query(), keysetPaginationQuery.fields(), sourceClass, |
|
|
|
keysetPaginationQuery.query(), keysetPaginationQuery.fields(), sourceClass, |
|
|
|
new QueryFindPublisherPreparer(query, keysetPaginationQuery.sort(), limit, 0, sourceClass), callback).collectList(); |
|
|
|
new QueryFindPublisherPreparer(query, keysetPaginationQuery.sort(), limit, 0, sourceClass), callback) |
|
|
|
|
|
|
|
.collectList(); |
|
|
|
|
|
|
|
|
|
|
|
return result.map(it -> ScrollUtils.createWindow(query, it, sourceClass, operations)); |
|
|
|
return result.map(it -> ScrollUtils.createWindow(query, it, sourceClass, operations)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2012,8 +2014,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati |
|
|
|
publisher = options.getCollation().map(Collation::toMongoCollation).map(publisher::collation) |
|
|
|
publisher = options.getCollation().map(Collation::toMongoCollation).map(publisher::collation) |
|
|
|
.orElse(publisher); |
|
|
|
.orElse(publisher); |
|
|
|
publisher = options.getResumeBsonTimestamp().map(publisher::startAtOperationTime).orElse(publisher); |
|
|
|
publisher = options.getResumeBsonTimestamp().map(publisher::startAtOperationTime).orElse(publisher); |
|
|
|
|
|
|
|
|
|
|
|
if(options.getFullDocumentBeforeChangeLookup().isPresent()) { |
|
|
|
if (options.getFullDocumentBeforeChangeLookup().isPresent()) { |
|
|
|
publisher = publisher.fullDocumentBeforeChange(options.getFullDocumentBeforeChangeLookup().get()); |
|
|
|
publisher = publisher.fullDocumentBeforeChange(options.getFullDocumentBeforeChangeLookup().get()); |
|
|
|
} |
|
|
|
} |
|
|
|
return publisher.fullDocument(options.getFullDocumentLookup().orElse(fullDocument)); |
|
|
|
return publisher.fullDocument(options.getFullDocumentLookup().orElse(fullDocument)); |
|
|
|
@ -2622,7 +2624,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati |
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtils.nullSafeEquals(WriteResultChecking.EXCEPTION, writeResultChecking)) { |
|
|
|
if (ObjectUtils.nullSafeEquals(WriteResultChecking.EXCEPTION, writeResultChecking)) { |
|
|
|
if (wc == null || wc.getWObject() == null |
|
|
|
if (wc == null || wc.getWObject() == null |
|
|
|
|| (wc.getWObject() instanceof Number concern && concern.intValue() < 1)) { |
|
|
|
|| (wc.getWObject()instanceof Number concern && concern.intValue() < 1)) { |
|
|
|
return WriteConcern.ACKNOWLEDGED; |
|
|
|
return WriteConcern.ACKNOWLEDGED; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -3200,8 +3202,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati |
|
|
|
|
|
|
|
|
|
|
|
HintFunction hintFunction = HintFunction.from(query.getHint()); |
|
|
|
HintFunction hintFunction = HintFunction.from(query.getHint()); |
|
|
|
Meta meta = query.getMeta(); |
|
|
|
Meta meta = query.getMeta(); |
|
|
|
if (skip <= 0 && limit <= 0 && ObjectUtils.isEmpty(sortObject) && hintFunction.isEmpty() |
|
|
|
if (skip <= 0 && limit <= 0 && ObjectUtils.isEmpty(sortObject) && hintFunction.isEmpty() && !meta.hasValues()) { |
|
|
|
&& !meta.hasValues()) { |
|
|
|
|
|
|
|
return findPublisherToUse; |
|
|
|
return findPublisherToUse; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|