Compare commits

..

23 Commits

Author SHA1 Message Date
Christoph Strobl
ede2f5eeda Fix method names in full text query documentation.
Closes #3525
2021-01-20 08:32:59 +01:00
Mark Paluch
49feb3d55e DATAMONGO-2641 - After release cleanups. 2020-10-28 11:22:23 +01:00
Mark Paluch
3e41264aeb DATAMONGO-2641 - Prepare next development iteration. 2020-10-28 11:22:20 +01:00
Mark Paluch
dd5b1f7989 DATAMONGO-2641 - Release version 2.1.21 (Lovelace SR21). 2020-10-28 11:03:41 +01:00
Mark Paluch
f4adc29c60 DATAMONGO-2641 - Prepare 2.1.21 (Lovelace SR21). 2020-10-28 11:03:05 +01:00
Mark Paluch
85807975e9 DATAMONGO-2641 - Updated changelog. 2020-10-28 11:02:56 +01:00
Christoph Strobl
f6f9bba2ff DATAMONGO-2626 - Updated changelog. 2020-10-14 14:51:45 +02:00
Mark Paluch
32b992b918 DATAMONGO-2608 - Updated changelog. 2020-09-16 14:12:04 +02:00
Mark Paluch
91c69eed10 DATAMONGO-2609 - Updated changelog. 2020-09-16 12:16:33 +02:00
Mark Paluch
314156a4cd DATAMONGO-2593 - Updated changelog. 2020-09-16 11:20:10 +02:00
Mark Paluch
1f5e2c714d DATAMONGO-2592 - After release cleanups. 2020-09-16 10:28:57 +02:00
Mark Paluch
949b1e596e DATAMONGO-2592 - Prepare next development iteration. 2020-09-16 10:28:54 +02:00
Mark Paluch
46d4206297 DATAMONGO-2592 - Release version 2.1.20 (Lovelace SR20). 2020-09-16 10:16:42 +02:00
Mark Paluch
86db5f8265 DATAMONGO-2592 - Prepare 2.1.20 (Lovelace SR20). 2020-09-16 10:16:10 +02:00
Mark Paluch
5aa4eb058d DATAMONGO-2592 - Updated changelog. 2020-09-16 10:15:54 +02:00
Christoph Strobl
71a077a599 DATAMONGO-2618 - Fix visibility of ReplaceRootDocumentOperation. 2020-09-14 13:46:30 +02:00
Michal Kurcius
25840d61fc DATAMONGO-2613 - Fix single element ArrayJsonSchemaObject to document mapping.
Now toDocument calls toDocument on items correctly.

Original Pull Request: #883
2020-08-20 10:07:04 +02:00
Mark Paluch
553912a380 DATAMONGO-2594 - Updated changelog. 2020-08-12 13:25:50 +02:00
Mark Paluch
b418fa16e5 DATAMONGO-2579 - Updated changelog. 2020-08-12 12:01:21 +02:00
Mark Paluch
2f627cc02d DATAMONGO-2568 - Updated changelog. 2020-07-22 10:38:00 +02:00
Mark Paluch
ba1b769c1a DATAMONGO-2567 - Updated changelog. 2020-07-22 10:08:46 +02:00
Mark Paluch
47747aca8d DATAMONGO-2566 - After release cleanups. 2020-07-22 09:42:54 +02:00
Mark Paluch
ce8a97b1e5 DATAMONGO-2566 - Prepare next development iteration. 2020-07-22 09:42:51 +02:00
11 changed files with 131 additions and 18 deletions

10
pom.xml
View File

@@ -5,7 +5,7 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>2.1.19.RELEASE</version>
<version>2.1.22.BUILD-SNAPSHOT</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.1.19.RELEASE</version>
<version>2.1.22.BUILD-SNAPSHOT</version>
</parent>
<modules>
@@ -27,7 +27,7 @@
<properties>
<project.type>multi</project.type>
<dist.id>spring-data-mongodb</dist.id>
<springdata.commons>2.1.19.RELEASE</springdata.commons>
<springdata.commons>2.1.22.BUILD-SNAPSHOT</springdata.commons>
<mongo>3.8.2</mongo>
<mongo.reactivestreams>1.9.2</mongo.reactivestreams>
<jmh.version>1.19</jmh.version>
@@ -155,8 +155,8 @@
<repositories>
<repository>
<id>spring-libs-release</id>
<url>https://repo.spring.io/libs-release</url>
<id>spring-libs-snapshot</id>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>
</repositories>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>2.1.19.RELEASE</version>
<version>2.1.22.BUILD-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>2.1.19.RELEASE</version>
<version>2.1.22.BUILD-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -50,7 +50,7 @@
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>2.1.19.RELEASE</version>
<version>2.1.22.BUILD-SNAPSHOT</version>
</dependency>
<!-- reactive -->

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>2.1.19.RELEASE</version>
<version>2.1.22.BUILD-SNAPSHOT</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>2.1.19.RELEASE</version>
<version>2.1.22.BUILD-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -155,7 +155,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

@@ -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 {
@@ -1194,7 +1195,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

@@ -22,6 +22,7 @@ import static org.springframework.data.mongodb.core.schema.JsonSchemaObject.of;
import static org.springframework.data.mongodb.test.util.Assertions.*;
import java.util.Arrays;
import java.util.Collections;
import org.bson.Document;
import org.junit.Test;
@@ -33,6 +34,7 @@ import org.springframework.data.domain.Range.*;
*
* @author Christoph Strobl
* @author Mark Paluch
* @author Michał Kurcius
*/
public class JsonSchemaObjectUnitTests {
@@ -209,6 +211,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

@@ -1436,7 +1436,7 @@ A query searching for `coffee cake`, sorted by relevance according to the `weigh
[source,java]
----
Query query = TextQuery.searching(new TextCriteria().matchingAny("coffee", "cake")).sortByScore();
Query query = TextQuery.queryText(new TextCriteria().matchingAny("coffee", "cake")).sortByScore();
List<Document> page = template.find(query, Document.class);
----
@@ -1445,8 +1445,8 @@ You can exclude search terms by prefixing the term with `-` or by using `notMatc
[source,java]
----
// search for 'coffee' and not 'cake'
TextQuery.searching(new TextCriteria().matching("coffee").matching("-cake"));
TextQuery.searching(new TextCriteria().matching("coffee").notMatching("cake"));
TextQuery.queryText(new TextCriteria().matching("coffee").matching("-cake"));
TextQuery.queryText(new TextCriteria().matching("coffee").notMatching("cake"));
----
`TextCriteria.matching` takes the provided term as is. Therefore, you can define phrases by putting them between double quotation marks (for example, `\"coffee cake\")` or using by `TextCriteria.phrase.` The following example shows both ways of defining a phrase:
@@ -1454,8 +1454,8 @@ TextQuery.searching(new TextCriteria().matching("coffee").notMatching("cake"));
[source,java]
----
// search for phrase 'coffee cake'
TextQuery.searching(new TextCriteria().matching("\"coffee cake\""));
TextQuery.searching(new TextCriteria().phrase("coffee cake"));
TextQuery.queryText(new TextCriteria().matching("\"coffee cake\""));
TextQuery.queryText(new TextCriteria().phrase("coffee cake"));
----
You can set flags for `$caseSensitive` and `$diacriticSensitive` by using the corresponding methods on `TextCriteria`. Note that these two optional flags have been introduced in MongoDB 3.2 and are not included in the query unless explicitly set.

View File

@@ -1,6 +1,97 @@
Spring Data MongoDB Changelog
=============================
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.
* DATAMONGO-2599 - Ambiguous field mapping detected for enum java.time.temporal.ChronoUnit.
* DATAMONGO-2598 - Wording changes.
* DATAMONGO-2594 - Release 3.0.3 (Neumann SR3).
Changes in version 3.1.0-M2 (2020-08-12)
----------------------------------------
* DATAMONGO-2603 - Adopt to Reactor 3.4 changes.
* DATAMONGO-2602 - Upgrade MongoDB drivers to 4.1.0.
* DATAMONGO-2601 - Consider Unit a void type in Coroutine repositories.
* DATAMONGO-2599 - Ambiguous field mapping detected for enum java.time.temporal.ChronoUnit.
* DATAMONGO-2598 - Wording changes.
* DATAMONGO-2591 - Upgrade MongoDB drivers to 4.1.0-rc0.
* DATAMONGO-2586 - Add support for reactive auditing.
* DATAMONGO-2579 - Release 3.1 M2 (2020.0.0).
* DATAMONGO-2571 - regex expression included "/" character can't be parsed in the stage of aggregation annotation.
* DATAMONGO-2536 - Add option to discard results on $out and $merge.
* DATAMONGO-2490 - @DBRef fetched without ClientSession when using Spring Transactions.
* DATAMONGO-1894 - Use reactive subscriber context for SpEL evaluation in query execution.
* DATAMONGO-1836 - Add support for hint option to aggregation.
Changes in version 3.0.2.RELEASE (2020-07-22)
---------------------------------------------
* DATAMONGO-2589 - Upgrade to MongoDB Driver 4.0.5.
* DATAMONGO-2572 - Remove usage of Oppressive Language.
* DATAMONGO-2571 - regex expression included "/" character can't be parsed in the stage of aggregation annotation.
* DATAMONGO-2570 - Avoiding unintentional unboxing.
* DATAMONGO-2568 - Release 3.0.2 (Neumann SR2).
* DATAMONGO-2536 - Add option to discard results on $out and $merge.
* DATAMONGO-2490 - @DBRef fetched without ClientSession when using Spring Transactions.
Changes in version 2.2.9.RELEASE (2020-07-22)
---------------------------------------------
* DATAMONGO-2572 - Remove usage of Oppressive Language.
* DATAMONGO-2571 - regex expression included "/" character can't be parsed in the stage of aggregation annotation.
* DATAMONGO-2570 - Avoiding unintentional unboxing.
* DATAMONGO-2567 - Release 2.2.9 (Moore SR9).
* DATAMONGO-2490 - @DBRef fetched without ClientSession when using Spring Transactions.
Changes in version 2.1.19.RELEASE (2020-07-22)
----------------------------------------------
* DATAMONGO-2572 - Remove usage of Oppressive Language.
@@ -3073,6 +3164,16 @@ Repository

View File

@@ -1,4 +1,4 @@
Spring Data MongoDB 2.1.19 (Lovelace SR19)
Spring Data MongoDB 2.1.21 (Lovelace SR21)
Copyright (c) [2010-2019] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -14,3 +14,5 @@ conditions of the subcomponent's license, as noted in the LICENSE file.