Compare commits

...

19 Commits
3.4.3 ... 3.4.5

Author SHA1 Message Date
Spring Builds
7ecc71299f Release version 3.4.5 (2021.2.5).
See #4207
2022-10-13 13:24:00 +00:00
Spring Builds
0a97fb92af Prepare 3.4.5 (2021.2.5).
See #4207
2022-10-13 13:21:28 +00:00
Spring Builds
423efcf33e After release cleanups.
See #4171
2022-10-13 09:23:53 +00:00
Spring Builds
9dbea7c120 Prepare next development iteration.
See #4171
2022-10-13 09:23:40 +00:00
Spring Builds
69ba8b5ba9 Release version 3.4.4 (2021.2.4).
See #4171
2022-10-13 08:59:50 +00:00
Spring Builds
91815a68c4 Prepare 3.4.4 (2021.2.4).
See #4171
2022-10-13 08:56:59 +00:00
Christoph Strobl
6949e4ad70 Update javadoc.
See: #4184
See: #4197
Original pull request: #4203.
2022-10-12 15:25:43 +02:00
Christoph Strobl
f53f6b9308 Preserve given Id on insert.
This commit fixes an issue where an existing Id got replaced with a generated one when using MongoId annotation.

Closes: #4184
Closes: #4197
Original pull request: #4203.
2022-10-12 15:25:31 +02:00
Christoph Strobl
fb3bda9e94 Update tests.
Original Pull Request: #4196
2022-10-11 09:48:57 +02:00
gongxuanzhang
c9ad0884ec Fix json schema type name for boolean.
Was boolean should have been bool.

Closes: #4196
2022-10-11 08:23:24 +02:00
Christoph Strobl
eba0a66e1c Update reactive transaction sample in reference documentation.
Closes: #4190
2022-10-06 13:18:37 +02:00
Christoph Ahlers
92ace88cac Fix javadoc parameter names.
Closes: #4179
2022-10-04 12:39:40 +02:00
Wan Bachtiar
24a5fcd5f5 Fix typo in reference documentation.
Closes: #4180
2022-10-04 12:25:32 +02:00
Seungwoo Jo
4fff480e17 Fix documentation typo in BasicQuery.
Closes #4169
Original pull request: #4170.
2022-09-21 10:58:17 +02:00
Mark Paluch
51160571fd Polishing.
Reformat code.

See #4004
Original pull request: #4006.
2022-09-21 10:48:30 +02:00
Christoph Strobl
b5c40e7427 Polishing
Update Javadoc to mention unit of measure for min/maxDistance depending on usage of geoJson.
Also remove unused imports from tests

See #4004
Original pull request: #4006.
2022-09-21 10:48:30 +02:00
Christoph Strobl
ee712f67db Fix rewrite near & nearSphere count queries using geoJson to geoWithin.
$near and $nearSphere queries are not supported via countDocuments and the used aggregation match stage and need to be rewritten to $geoWithin. The existing logic did not cover usage of geoJson types, which is fixed now. In case of nearSphere it is also required to convert the $maxDistance argument (given in meters for geoJson) to radians which is used by $geoWithin $centerSphere.

Closes #4004
Original pull request: #4006.
Related to #2925
2022-09-21 10:48:30 +02:00
Spring Builds
de2a0373bb After release cleanups.
See #4116
2022-09-19 12:00:17 +00:00
Spring Builds
baa897ff2b Prepare next development iteration.
See #4116
2022-09-19 12:00:05 +00:00
27 changed files with 206 additions and 43 deletions

View File

@@ -5,7 +5,7 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.3</version>
<version>3.4.5</version>
<packaging>pom</packaging>
<name>Spring Data MongoDB</name>
@@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.7.3</version>
<version>2.7.5</version>
</parent>
<modules>
@@ -26,7 +26,7 @@
<properties>
<project.type>multi</project.type>
<dist.id>spring-data-mongodb</dist.id>
<springdata.commons>2.7.3</springdata.commons>
<springdata.commons>2.7.5</springdata.commons>
<mongo>4.6.1</mongo>
<mongo.reactivestreams>${mongo}</mongo.reactivestreams>
<jmh.version>1.19</jmh.version>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.3</version>
<version>3.4.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.3</version>
<version>3.4.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.3</version>
<version>3.4.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -23,8 +23,8 @@ import java.util.List;
import java.util.Map;
import org.bson.Document;
import org.springframework.data.geo.Point;
import org.springframework.data.mongodb.core.query.MetricConversion;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;
@@ -38,7 +38,7 @@ import org.springframework.util.ObjectUtils;
*/
class CountQuery {
private Document source;
private final Document source;
private CountQuery(Document source) {
this.source = source;
@@ -101,7 +101,7 @@ class CountQuery {
}
if (valueToInspect instanceof Collection) {
return requiresRewrite((Collection) valueToInspect);
return requiresRewrite((Collection<?>) valueToInspect);
}
return false;
@@ -157,12 +157,14 @@ class CountQuery {
* @param $and potentially existing {@code $and} condition.
* @return the rewritten query {@link Document}.
*/
@SuppressWarnings("unchecked")
private static Document createGeoWithin(String key, Document source, @Nullable Object $and) {
boolean spheric = source.containsKey("$nearSphere");
Object $near = spheric ? source.get("$nearSphere") : source.get("$near");
Number maxDistance = source.containsKey("$maxDistance") ? (Number) source.get("$maxDistance") : Double.MAX_VALUE;
Number maxDistance = getMaxDistance(source, $near, spheric);
List<Object> $centerMax = Arrays.asList(toCenterCoordinates($near), maxDistance);
Document $geoWithinMax = new Document("$geoWithin",
new Document(spheric ? "$centerSphere" : "$center", $centerMax));
@@ -180,7 +182,7 @@ class CountQuery {
if ($and != null) {
if ($and instanceof Collection) {
Collection andElements = (Collection) $and;
Collection<Document> andElements = (Collection<Document>) $and;
criteria = new ArrayList<>(andElements.size() + 2);
criteria.addAll(andElements);
} else {
@@ -194,9 +196,35 @@ class CountQuery {
criteria.add(new Document("$nor", Collections.singletonList(new Document(key, $geoWithinMin))));
criteria.add(new Document(key, $geoWithinMax));
return new Document("$and", criteria);
}
private static Number getMaxDistance(Document source, Object $near, boolean spheric) {
Number maxDistance = Double.MAX_VALUE;
if (source.containsKey("$maxDistance")) { // legacy coordinate pair
return (Number) source.get("$maxDistance");
}
if ($near instanceof Document) {
Document nearDoc = (Document) $near;
if (nearDoc.containsKey("$maxDistance")) {
maxDistance = (Number) nearDoc.get("$maxDistance");
// geojson is in Meters but we need radians x/(6378.1*1000)
if (spheric && nearDoc.containsKey("$geometry")) {
maxDistance = MetricConversion.metersToRadians(maxDistance.doubleValue());
}
}
}
return maxDistance;
}
private static boolean containsNear(Document source) {
return source.containsKey("$near") || source.containsKey("$nearSphere");
}
@@ -220,10 +248,17 @@ class CountQuery {
return Arrays.asList(((Point) value).getX(), ((Point) value).getY());
}
if (value instanceof Document && ((Document) value).containsKey("x")) {
if (value instanceof Document) {
Document document = (Document) value;
Document point = (Document) value;
return Arrays.asList(point.get("x"), point.get("y"));
if (document.containsKey("x")) {
return Arrays.asList(document.get("x"), document.get("y"));
}
if (document.containsKey("$geometry")) {
Document geoJsonPoint = document.get("$geometry", Document.class);
return geoJsonPoint.get("coordinates");
}
}
return value;

View File

@@ -1303,9 +1303,10 @@ public interface MongoOperations extends FluentMongoOperations {
/**
* Insert the object into the collection for the entity type of the object to save. <br />
* The object is converted to the MongoDB native representation using an instance of {@see MongoConverter}. <br />
* If your object has an "Id' property, it will be set with the generated Id from MongoDB. If your Id property is a
* String then MongoDB ObjectId will be used to populate that string. Otherwise, the conversion from ObjectId to your
* property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See
* If your object has an {@literal Id} property which holds a {@literal null} value, it will be set with the generated
* Id from MongoDB. If your Id property is a String then MongoDB ObjectId will be used to populate that string.
* Otherwise, the conversion from ObjectId to your property type will be handled by Spring's BeanWrapper class that
* leverages Type Conversion API. See
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
* Type Conversion"</a> for more details. <br />
* Insert is used to initially store the object into the database. To update an existing object use the save method.

View File

@@ -272,7 +272,7 @@ class QueryOperations {
*/
<T> MappedDocument prepareId(@Nullable MongoPersistentEntity<T> entity) {
if (entity == null) {
if (entity == null || source.hasId()) {
return source;
}

View File

@@ -1110,9 +1110,10 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
* <br />
* The object is converted to the MongoDB native representation using an instance of {@see MongoConverter}.
* <br />
* If your object has an "Id' property, it will be set with the generated Id from MongoDB. If your Id property is a
* String then MongoDB ObjectId will be used to populate that string. Otherwise, the conversion from ObjectId to your
* property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See
* If your object has an {@literal Id} property which holds a {@literal null} value, it will be set with the generated
* Id from MongoDB. If your Id property is a String then MongoDB ObjectId will be used to populate that string.
* Otherwise, the conversion from ObjectId to your property type will be handled by Spring's BeanWrapper class that
* leverages Type Conversion API. See
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
* Type Conversion"</a> for more details.
* <br />

View File

@@ -446,7 +446,7 @@ public class ScriptOperators {
/**
* Define the optional {@code initArgs} for the {@link #init(String)} function.
*
* @param function must not be {@literal null}.
* @param args must not be {@literal null}.
* @return this.
*/
@Override

View File

@@ -73,7 +73,7 @@ public class BasicQuery extends Query {
*
* @param queryObject must not be {@literal null}.
* @param fieldsObject must not be {@literal null}.
* @throws IllegalArgumentException when {@code sortObject} or {@code fieldsObject} is {@literal null}.
* @throws IllegalArgumentException when {@code queryObject} or {@code fieldsObject} is {@literal null}.
*/
public BasicQuery(Document queryObject, Document fieldsObject) {

View File

@@ -624,9 +624,13 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a geo-spatial criterion using a {@literal $maxDistance} operation, for use with $near
* Creates a geo-spatial criterion using a {@literal $maxDistance} operation, for use with {@literal $near} or
* {@literal $nearSphere}.
* <p>
* <strong>NOTE:</strong> The unit of measure for distance may depends on the used coordinate representation
* (legacy vs. geoJson) as well as the target operation.
*
* @param maxDistance
* @param maxDistance radians or meters
* @return this.
* @see <a href="https://docs.mongodb.com/manual/reference/operator/query/maxDistance/">MongoDB Query operator:
* $maxDistance</a>
@@ -645,8 +649,11 @@ public class Criteria implements CriteriaDefinition {
/**
* Creates a geospatial criterion using a {@literal $minDistance} operation, for use with {@literal $near} or
* {@literal $nearSphere}.
* <p>
* <strong>NOTE:</strong> The unit of measure for distance may depends on the used coordinate representation
* (legacy vs. geoJson) as well as the target operation.
*
* @param minDistance
* @param minDistance radians or meters
* @return this.
* @since 1.7
*/

View File

@@ -17,6 +17,7 @@
package org.springframework.data.mongodb.core.query;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import org.springframework.data.geo.Distance;
@@ -27,6 +28,7 @@ import org.springframework.data.geo.Metrics;
* {@link Metric} and {@link Distance} conversions using the metric system.
*
* @author Mark Paluch
* @author Christoph Strobl
* @since 2.2
*/
public class MetricConversion {
@@ -61,6 +63,28 @@ public class MetricConversion {
.doubleValue();
}
/**
* Return {@code distance} in radians (on an earth like sphere).
*
* @param distance must not be {@literal null}.
* @return distance in radians.
* @since 3.4.4
*/
public static double toRadians(Distance distance) {
return metersToRadians(getDistanceInMeters(distance));
}
/**
* Return {@code distance} in radians (on an earth like sphere).
*
* @param meters
* @return distance in radians.
* @since 3.4.4
*/
public static double metersToRadians(double meters) {
return BigDecimal.valueOf(meters).divide(METERS_MULTIPLIER, MathContext.DECIMAL64).doubleValue();
}
/**
* Return {@code metric} to meters multiplier.
*

View File

@@ -295,7 +295,7 @@ public interface JsonSchemaObject {
Type OBJECT = jsonTypeOf("object");
Type ARRAY = jsonTypeOf("array");
Type NUMBER = jsonTypeOf("number");
Type BOOLEAN = jsonTypeOf("boolean");
Type BOOLEAN = jsonTypeOf("bool");
Type STRING = jsonTypeOf("string");
Type NULL = jsonTypeOf("null");

View File

@@ -15,20 +15,17 @@
*/
package org.springframework.data.mongodb.core;
import static org.mockito.Mockito.*;
import static org.springframework.data.mongodb.core.query.Criteria.*;
import static org.springframework.data.mongodb.core.query.Query.*;
import static org.springframework.data.mongodb.test.util.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.data.geo.Point;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.convert.NoOpDbRefResolver;
import org.springframework.data.mongodb.core.convert.QueryMapper;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
import org.springframework.data.mongodb.core.query.Criteria;
@@ -155,6 +152,39 @@ class CountQueryUnitTests {
"{\"$or\" : [ { \"name\": \"food\" }, {\"location\": {\"$geoWithin\": {\"$center\": [[-73.99171, 40.738868], 10.0]}}} ]}"));
}
@Test // GH-4004
void nearToGeoWithinWithMaxDistanceUsingGeoJsonSource() {
Query source = query(new Criteria().orOperator(where("name").is("food"),
where("location").near(new GeoJsonPoint(-73.99171, 40.738868)).maxDistance(10)));
org.bson.Document target = postProcessQueryForCount(source);
assertThat(target).isEqualTo(org.bson.Document.parse(
"{\"$or\" : [ { \"name\": \"food\" }, {\"location\": {\"$geoWithin\": {\"$center\": [[-73.99171, 40.738868], 10.0]}}} ]}"));
}
@Test // GH-4004
void nearSphereToGeoWithinWithoutMaxDistanceUsingGeoJsonSource() {
Query source = query(new Criteria().orOperator(where("name").is("food"),
where("location").nearSphere(new GeoJsonPoint(-73.99171, 40.738868))));
org.bson.Document target = postProcessQueryForCount(source);
assertThat(target).isEqualTo(org.bson.Document.parse(
"{\"$or\" : [ { \"name\": \"food\" }, {\"location\": {\"$geoWithin\": {\"$centerSphere\": [[-73.99171, 40.738868], 1.7976931348623157E308]}}} ]}"));
}
@Test // GH-4004
void nearSphereToGeoWithinWithMaxDistanceUsingGeoJsonSource() {
Query source = query(new Criteria().orOperator(where("name").is("food"), where("location")
.nearSphere(new GeoJsonPoint(-73.99171, 40.738868)).maxDistance/*in meters for geojson*/(10d)));
org.bson.Document target = postProcessQueryForCount(source);
assertThat(target).isEqualTo(org.bson.Document.parse(
"{\"$or\" : [ { \"name\": \"food\" }, {\"location\": {\"$geoWithin\": {\"$centerSphere\": [[-73.99171, 40.738868], 1.567855942887398E-6]}}} ]}"));
}
private org.bson.Document postProcessQueryForCount(Query source) {
org.bson.Document intermediate = mapper.getMappedObject(source.getQueryObject(), (MongoPersistentEntity<?>) null);

View File

@@ -292,7 +292,7 @@ class MappingMongoJsonSchemaCreatorUnitTests {
" 're-named-property' : { 'type' : 'string' }," + //
" 'retypedProperty' : { 'bsonType' : 'javascript' }," + //
" 'primitiveInt' : { 'bsonType' : 'int' }," + //
" 'booleanProperty' : { 'type' : 'boolean' }," + //
" 'booleanProperty' : { 'type' : 'bool' }," + //
" 'longProperty' : { 'bsonType' : 'long' }," + //
" 'intProperty' : { 'bsonType' : 'int' }," + //
" 'dateProperty' : { 'bsonType' : 'date' }," + //

View File

@@ -3659,6 +3659,26 @@ public class MongoTemplateTests {
assertThat(target).isEqualTo(source);
}
@Test // GH-4184
void insertHonorsExistingRawId() {
RawStringId source = new RawStringId();
source.id = "abc";
source.value = "new value";
template.insert(source);
org.bson.Document result = template
.execute(db -> db.getCollection(template.getCollectionName(RawStringId.class))
.find().limit(1).cursor().next());
assertThat(result).isNotNull();
assertThat(result.get("_id")).isEqualTo("abc");
RawStringId target = template.findOne(query(where("id").is(source.id)), RawStringId.class);
assertThat(target).isEqualTo(source);
}
@Test // GH-4026
void saveShouldGenerateNewIdOfTypeIfExplicitlyDefined() {

View File

@@ -205,6 +205,15 @@ class QueryOperationsUnitTests {
});
}
@Test // GH-4184
void insertContextDoesNotOverrideExistingId() {
assertThat(queryOperations.createInsertContext(new Document("_id", "abc")).prepareId(Person.class).getDocument())//
.satisfies(result -> {
assertThat(result).isEqualTo(new Document("_id", "abc"));
});
}
static class Person {
}

View File

@@ -219,6 +219,23 @@ public class ReactiveMongoTemplateTests {
}).verifyComplete();
}
@Test // GH-4184
void insertHonorsExistingRawId() {
MongoTemplateTests.RawStringId source = new MongoTemplateTests.RawStringId();
source.id = "abc";
source.value = "new value";
template.insert(source)
.then(template.execute(db -> Flux.from(
db.getCollection(template.getCollectionName(MongoTemplateTests.RawStringId.class)).find().limit(1).first()))
.next())
.as(StepVerifier::create).consumeNextWith(result -> {
assertThat(result).isNotNull();
assertThat(result.get("_id")).isEqualTo("abc");
});
}
@Test // DATAMONGO-1444
void insertsSimpleEntityCorrectly() {

View File

@@ -66,6 +66,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.NearQuery;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.repository.Person;
import org.springframework.data.mongodb.test.util.EnableIfMongoServerVersion;
import org.springframework.data.mongodb.test.util.MongoTemplateExtension;
import org.springframework.data.mongodb.test.util.MongoTestTemplate;
import org.springframework.data.mongodb.test.util.MongoVersion;
@@ -312,6 +313,7 @@ public class AggregationTests {
}
@Test // DATAMONGO-1391
@EnableIfMongoServerVersion(isLessThan = "6.0")
void shouldUnwindPreserveEmpty() {
MongoCollection<Document> coll = mongoTemplate.getCollection(INPUT_COLLECTION);

View File

@@ -117,8 +117,8 @@ public class GeoSpatialIndexTests extends AbstractIntegrationTests {
/**
* Returns whether an index with the given name exists for the given entity type.
*
* @param indexName
* @param entityType
* @param type
* @return
*/
private boolean hasIndexOfType(Class<?> entityType, final String type) {

View File

@@ -45,7 +45,7 @@ class SubscriptionUtils {
* Wait for all {@link Subscription Subscriptions} to {@link Subscription#isActive() become active} but not longer
* than {@link #DEFAULT_TIMEOUT}.
*
* @param subscription
* @param subscriptions
* @throws InterruptedException
*/
static void awaitSubscriptions(Subscription... subscriptions) throws InterruptedException {
@@ -131,7 +131,8 @@ class SubscriptionUtils {
/**
* {@link MessageListener} implementation collecting received {@link Message messages}.
*
* @param <M>
* @param <S> source message type.
* @param <T> target message type.
*/
static class CollectingMessageListener<S, T> implements MessageListener<S, T> {

View File

@@ -65,4 +65,18 @@ public class MetricConversionUnitTests {
assertThat(multiplier).isCloseTo(0.00062137, offset(0.000000001));
}
@Test // GH-4004
void shouldConvertMetersToRadians/* on an earth like sphere with r=6378.137km */() {
assertThat(MetricConversion.metersToRadians(1000)).isCloseTo(0.000156785594d, offset(0.000000001));
}
@Test // GH-4004
void shouldConvertKilometersToRadians/* on an earth like sphere with r=6378.137km */() {
assertThat(MetricConversion.toRadians(new Distance(1, Metrics.KILOMETERS))).isCloseTo(0.000156785594d, offset(0.000000001));
}
@Test // GH-4004
void shouldConvertMilesToRadians/* on an earth like sphere with r=6378.137km */() {
assertThat(MetricConversion.toRadians(new Distance(1, Metrics.MILES))).isCloseTo(0.000252321328d, offset(0.000000001));
}
}

View File

@@ -133,7 +133,7 @@ class JsonSchemaObjectUnitTests {
.append("description", "Must be an object defining restrictions for name, active.").append("properties",
new Document("name", new Document("type", "string")
.append("description", "Must be a string with length unbounded-10].").append("maxLength", 10))
.append("active", new Document("type", "boolean")));
.append("active", new Document("type", "bool")));
assertThat(object().generatedDescription()
.properties(JsonSchemaProperty.string("name").maxLength(10).generatedDescription(),
@@ -266,7 +266,7 @@ class JsonSchemaObjectUnitTests {
void arrayObjectShouldRenderItemsCorrectly() {
assertThat(array().items(Arrays.asList(string(), bool())).toDocument()).isEqualTo(new Document("type", "array")
.append("items", Arrays.asList(new Document("type", "string"), new Document("type", "boolean"))));
.append("items", Arrays.asList(new Document("type", "string"), new Document("type", "bool"))));
}
@Test // DATAMONGO-2613
@@ -316,7 +316,7 @@ class JsonSchemaObjectUnitTests {
void booleanShouldRenderCorrectly() {
assertThat(bool().generatedDescription().toDocument())
.isEqualTo(new Document("type", "boolean").append("description", "Must be a boolean."));
.isEqualTo(new Document("type", "bool").append("description", "Must be a boolean."));
}
// -----------------

View File

@@ -32,7 +32,7 @@ public abstract class Assertions extends org.assertj.core.api.Assertions {
/**
* Create assertion for {@link Document}.
*
* @param actual the actual value.
* @param document the actual value.
* @return the created assertion object.
*/
public static DocumentAssert assertThat(Document document) {

View File

@@ -302,10 +302,10 @@ The following example shows how to create and use transactions with a `ReactiveM
[source,java]
----
@Configuration
static class Config extends AbstractMongoClientConfiguration {
public class Config extends AbstractReactiveMongoConfiguration {
@Bean
ReactiveMongoTransactionManager transactionManager(ReactiveDatabaseFactory factory) { <1>
ReactiveMongoTransactionManager transactionManager(ReactiveMongoDatabaseFactory factory) { <1>
return new ReactiveMongoTransactionManager(factory);
}

View File

@@ -349,7 +349,7 @@ static class Patient {
[TIP]
====
The `@Encrypted` Annoation supports resolving keyIds via SpEL Expressions.
The `@Encrypted` Annotation supports resolving keyIds via SpEL Expressions.
To do so additional environment metadata (via the `MappingContext`) is required and must be provided.
[source,java]

View File

@@ -1,4 +1,4 @@
Spring Data MongoDB 3.4.3 (2021.2.3)
Spring Data MongoDB 3.4.5 (2021.2.5)
Copyright (c) [2010-2019] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -38,6 +38,8 @@ conditions of the subcomponent's license, as noted in the LICENSE file.