Compare commits

..

24 Commits

Author SHA1 Message Date
Mark Paluch
52c554cfe1 DATAMONGO-2625 - Release version 3.0.5 (Neumann SR5). 2020-10-28 14:34:40 +01:00
Mark Paluch
c1bb8c4ba5 DATAMONGO-2625 - Prepare 3.0.5 (Neumann SR5). 2020-10-28 14:34:15 +01:00
Mark Paluch
ed9a367bb8 DATAMONGO-2625 - Updated changelog. 2020-10-28 14:34:04 +01:00
Mark Paluch
b88ce46239 DATAMONGO-2624 - Updated changelog. 2020-10-28 12:15:06 +01:00
Mark Paluch
42ec94d321 DATAMONGO-2641 - Updated changelog. 2020-10-28 11:32:32 +01:00
Robin Dupret
53f35e185f DATAMONGO-2638 - Fix list item rendering in reference documentation.
Original Pull Request: #885
2020-10-27 13:33:15 +01:00
LiangYong
e08bfd253c DATAMONGO-2638 - Fix aggregation input parameter syntax in reference documentation.
Original Pull Request: #881
2020-10-27 13:33:11 +01:00
Mark Paluch
caaafa275d DATAMONGO-2643 - Adopt to AssertJ API changes. 2020-10-26 10:59:30 +01:00
Christoph Strobl
1f082abc7f DATAMONGO-2626 - Updated changelog. 2020-10-14 14:51:55 +02:00
Mark Paluch
df77fcc19d DATAMONGO-2616 - Polishing.
Reformat code. Merge if-statements.

Original pull request: #889.
2020-10-07 11:35:57 +02:00
Christoph Strobl
007b965673 DATAMONGO-2616 - Short circuit id value assignment in MongoConverter.
Original pull request: #889.
2020-10-07 11:35:57 +02:00
Christoph Strobl
1b9680cece DATAMONGO-2633 - Fix json parsing of nested arrays in ParameterBindingDocumentCodec.
Original pull request: #888.
2020-10-05 15:35:07 +02:00
Mark Paluch
13f1d21919 DATAMONGO-2608 - Updated changelog. 2020-09-16 14:12:10 +02:00
Mark Paluch
4c10bf30bc DATAMONGO-2609 - After release cleanups. 2020-09-16 12:15:45 +02:00
Mark Paluch
8f78d0e0d8 DATAMONGO-2609 - Prepare next development iteration. 2020-09-16 12:15:40 +02:00
Mark Paluch
56115a263c DATAMONGO-2609 - Release version 3.0.4 (Neumann SR4). 2020-09-16 11:43:14 +02:00
Mark Paluch
66b809318a DATAMONGO-2609 - Prepare 3.0.4 (Neumann SR4). 2020-09-16 11:42:46 +02:00
Mark Paluch
bfff60d915 DATAMONGO-2609 - Updated changelog. 2020-09-16 11:42:29 +02:00
Mark Paluch
051e973226 DATAMONGO-2593 - Updated changelog. 2020-09-16 11:20:13 +02:00
Mark Paluch
eb61629f10 DATAMONGO-2592 - Updated changelog. 2020-09-16 10:39:02 +02:00
Christoph Strobl
85783e5354 DATAMONGO-2618 - Fix visibility of ReplaceRootDocumentOperation. 2020-09-14 13:44:36 +02:00
Michal Kurcius
433b012b91 DATAMONGO-2613 - Fix single element ArrayJsonSchemaObject to document mapping.
Now toDocument calls toDocument on items correctly.

Original Pull Request: #883
2020-08-20 09:05:58 +02:00
Mark Paluch
8dca0049ca DATAMONGO-2594 - After release cleanups. 2020-08-12 13:19:58 +02:00
Mark Paluch
635f3b82be DATAMONGO-2594 - Prepare next development iteration. 2020-08-12 13:19:55 +02:00
15 changed files with 105 additions and 25 deletions

View File

@@ -5,7 +5,7 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.0.3.RELEASE</version>
<version>3.0.5.RELEASE</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.3.3.RELEASE</version>
<version>2.3.5.RELEASE</version>
</parent>
<modules>
@@ -26,7 +26,7 @@
<properties>
<project.type>multi</project.type>
<dist.id>spring-data-mongodb</dist.id>
<springdata.commons>2.3.3.RELEASE</springdata.commons>
<springdata.commons>2.3.5.RELEASE</springdata.commons>
<mongo>4.0.5</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.0.3.RELEASE</version>
<version>3.0.5.RELEASE</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.0.3.RELEASE</version>
<version>3.0.5.RELEASE</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.0.3.RELEASE</version>
<version>3.0.5.RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -175,7 +175,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*
* @author Mark Paluch
*/
static class ReplaceRootDocumentOperation extends ReplaceRootOperation {
public static class ReplaceRootDocumentOperation extends ReplaceRootOperation {
private final static ReplacementDocument EMPTY = new ReplacementDocument();
private final ReplacementDocument current;

View File

@@ -127,8 +127,8 @@ public interface MongoConverter
@Nullable
default Object convertId(@Nullable Object id, Class<?> targetType) {
if (id == null) {
return null;
if (id == null || ClassUtils.isAssignableValue(targetType, id)) {
return id;
}
if (ClassUtils.isAssignable(ObjectId.class, targetType)) {

View File

@@ -41,6 +41,7 @@ import org.springframework.util.StringUtils;
*
* @author Christoph Strobl
* @author Mark Paluch
* @author Michał Kurcius
* @since 2.1
*/
public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
@@ -1203,7 +1204,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
Document doc = new Document(super.toDocument());
if (!CollectionUtils.isEmpty(items)) {
doc.append("items", items.size() == 1 ? items.iterator().next()
doc.append("items", items.size() == 1 ? items.iterator().next().toDocument()
: items.stream().map(JsonSchemaObject::toDocument).collect(Collectors.toList()));
}

View File

@@ -336,15 +336,7 @@ public class ParameterBindingDocumentCodec implements CollectibleCodec<Document>
reader.readStartArray();
List<Object> list = new ArrayList<>();
while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
// Spring Data Customization START
Object listValue = readValue(reader, decoderContext);
if (listValue instanceof Collection) {
list.addAll((Collection) listValue);
break;
}
list.add(listValue);
// Spring Data Customization END
list.add(readValue(reader, decoderContext));
}
reader.readEndArray();
return list;

View File

@@ -1884,8 +1884,7 @@ public class MappingMongoConverterUnitTests {
WithNestedLists result = converter.read(WithNestedLists.class, document);
assertThat(result.nestedFloats).hasSize(1);
assertThat(result.nestedFloats).isEqualTo(new float[][][] { { { 1.0f, 2.0f } } });
assertThat(result.nestedFloats).hasDimensions(1, 1).isEqualTo(new float[][][] { { { 1.0f, 2.0f } } });
}
@Test // DATAMONGO-1992

View File

@@ -41,6 +41,7 @@ import org.springframework.data.domain.Range.*;
*
* @author Christoph Strobl
* @author Mark Paluch
* @author Michał Kurcius
*/
public class JsonSchemaObjectUnitTests {
@@ -269,6 +270,13 @@ public class JsonSchemaObjectUnitTests {
.append("items", Arrays.asList(new Document("type", "string"), new Document("type", "boolean"))));
}
@Test // DATAMONGO-2613
public void arrayObjectShouldRenderItemsCorrectlyAsObjectIfContainsOnlyOneElement() {
assertThat(array().items(Collections.singletonList(string())).toDocument()).isEqualTo(new Document("type", "array")
.append("items", new Document("type", "string")));
}
@Test // DATAMONGO-1835
public void arrayObjectShouldRenderMaxItemsCorrectly() {

View File

@@ -349,6 +349,15 @@ class ParameterBindingJsonReaderUnitTests {
.isEqualTo(Document.parse("{ $and: [{'fieldA': {$in: [/ABC.*/, /CDE.*F/]}}, {'fieldB': {$ne: null}}]}"));
}
@Test // DATAMONGO-2633
void shouldParseNestedArrays() {
Document target = parse("{ 'stores.location' : { $geoWithin: { $centerSphere: [ [ ?0, 48.799029 ] , ?1 ] } } }",
1.948516D, 0.004D);
assertThat(target).isEqualTo(Document
.parse("{ 'stores.location' : { $geoWithin: { $centerSphere: [ [ 1.948516, 48.799029 ] , 0.004 ] } } }"));
}
private static Document parse(String json, Object... args) {
ParameterBindingJsonReader reader = new ParameterBindingJsonReader(json, args);

View File

@@ -17,10 +17,10 @@ public interface PersonRepository extends CrudReppsitory<Person, String> {
@Aggregation("{ $group: { _id : $lastname, names : { $addToSet : $firstname } } }")
List<PersonAggregate> groupByLastnameAndFirstnames(Sort sort); <2>
@Aggregation("{ $group: { _id : $lastname, names : { $addToSet : $?0 } } }")
@Aggregation("{ $group: { _id : $lastname, names : { $addToSet : ?0 } } }")
List<PersonAggregate> groupByLastnameAnd(String property); <3>
@Aggregation("{ $group: { _id : $lastname, names : { $addToSet : $?0 } } }")
@Aggregation("{ $group: { _id : $lastname, names : { $addToSet : ?0 } } }")
List<PersonAggregate> groupByLastnameAnd(String property, Pageable page); <4>
@Aggregation("{ $group : { _id : null, total : { $sum : $age } } }")

View File

@@ -27,7 +27,7 @@ First, you need to set up a running MongoDB server. Refer to the https://docs.mo
To create a Spring project in STS:
. Go to File -> New -> Spring Template Project -> Simple Spring Utility Project, and press Yes when prompted. Then enter a project and a package name, such as `org.spring.mongodb.example`.
.Add the following to the pom.xml files `dependencies` element:
. Add the following to the pom.xml files `dependencies` element:
+
[source,xml,subs="+attributes"]
----

View File

@@ -1,6 +1,67 @@
Spring Data MongoDB Changelog
=============================
Changes in version 3.0.5.RELEASE (2020-10-28)
---------------------------------------------
* DATAMONGO-2643 - Adopt to AssertJ API changes.
* DATAMONGO-2638 - Fix documentation issues.
* DATAMONGO-2633 - @Query annotation does not support $centerSphere.
* DATAMONGO-2625 - Release 3.0.5 (Neumann SR5).
Changes in version 2.2.11.RELEASE (2020-10-28)
----------------------------------------------
* DATAMONGO-2638 - Fix documentation issues.
* DATAMONGO-2633 - @Query annotation does not support $centerSphere.
* DATAMONGO-2624 - Release 2.2.11 (Moore SR11).
Changes in version 2.1.21.RELEASE (2020-10-28)
----------------------------------------------
* DATAMONGO-2641 - Release 2.1.21 (Lovelace SR21).
Changes in version 3.1.0-RC2 (2020-10-14)
-----------------------------------------
* DATAMONGO-2633 - @Query annotation does not support $centerSphere.
* DATAMONGO-2630 - Add support for suspend repository query methods returning List<T>.
* DATAMONGO-2626 - Release 3.1 RC2 (2020.0.0).
* DATAMONGO-2623 - Add support for custom Aggregation expressions.
* DATAMONGO-2622 - Add support for $unionWith aggregation.
* DATAMONGO-2596 - Introduce extension to render KProperty/KPropertyPath as property path.
* DATAMONGO-2294 - Support multiple parameters for query field projections.
Changes in version 3.1.0-RC1 (2020-09-16)
-----------------------------------------
* DATAMONGO-2621 - Adapt to changed array assertions in AssertJ.
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2608 - Release 3.1 RC1 (2020.0.0).
Changes in version 3.0.4.RELEASE (2020-09-16)
---------------------------------------------
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2609 - Release 3.0.4 (Neumann SR4).
Changes in version 2.2.10.RELEASE (2020-09-16)
----------------------------------------------
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2599 - Ambiguous field mapping detected for enum java.time.temporal.ChronoUnit.
* DATAMONGO-2593 - Release 2.2.10 (Moore SR10).
Changes in version 2.1.20.RELEASE (2020-09-16)
----------------------------------------------
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2592 - Release 2.1.20 (Lovelace SR20).
Changes in version 3.0.3.RELEASE (2020-08-12)
---------------------------------------------
* DATAMONGO-2601 - Consider Unit a void type in Coroutine repositories.
@@ -3132,6 +3193,14 @@ Repository

View File

@@ -1,4 +1,4 @@
Spring Data MongoDB 3.0.3 (Neumann SR3)
Spring Data MongoDB 3.0.5 (Neumann SR5)
Copyright (c) [2010-2019] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -18,3 +18,5 @@ conditions of the subcomponent's license, as noted in the LICENSE file.