Skip to content

Commit 6be07ad

Browse files
committed
DATAMONGO-1245 - Update documentation.
1 parent 4223a0c commit 6be07ad

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/main/asciidoc/index.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= Spring Data MongoDB - Reference Documentation
2-
Mark Pollack; Thomas Risberg; Oliver Gierke; Costin Leau; Jon Brisbin; Thomas Darimont; Christoph Strobl
2+
Mark Pollack; Thomas Risberg; Oliver Gierke; Costin Leau; Jon Brisbin; Thomas Darimont; Christoph Strobl; Mark Paluch
33
:revnumber: {version}
44
:revdate: {localdate}
55
:toc:
@@ -27,8 +27,6 @@ include::{spring-data-commons-docs}/repositories.adoc[]
2727
include::reference/introduction.adoc[]
2828
include::reference/mongodb.adoc[]
2929
include::reference/mongo-repositories.adoc[]
30-
include::{spring-data-commons-docs}/query-by-example.adoc[]
31-
include::reference/query-by-example.adoc[]
3230
include::{spring-data-commons-docs}/auditing.adoc[]
3331
include::reference/mongo-auditing.adoc[]
3432
include::reference/mapping.adoc[]

src/main/asciidoc/reference/mongodb.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,10 @@ TextQuery.searching(new TextCriteria().matching("\"coffee cake\""));
13301330
TextQuery.searching(new TextCriteria().phrase("coffee cake"));
13311331
----
13321332

1333+
include::../{spring-data-commons-docs}/query-by-example.adoc[]
1334+
include::query-by-example.adoc[]
1335+
1336+
13331337
[[mongo.mapreduce]]
13341338
== Map-Reduce Operations
13351339

src/main/asciidoc/reference/query-by-example.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[query.by.example.execution]]
2-
== Executing Query by Example
2+
=== Executing Example
33

44
In Spring Data MongoDB you can use Query by Example with the `MongoTemplate` and with Repositories.
55

@@ -17,7 +17,7 @@ public class PersonService {
1717
----
1818
====
1919

20-
`MongoTemplate.findByExample` accepts either the probe or an `Example` object to create and execute a query.
20+
`MongoTemplate.findByExample` accepts either the probe or an `Example` object to create and execute a query. An `Example` containing an untyped `ExampleSpec` uses the probe type to determine the collection name and the result type. Typed `ExampleSpec` use their type to determine collection name and result type.
2121

2222

2323
.Query by Example using a Repository
@@ -39,6 +39,8 @@ public class PersonService {
3939
----
4040
====
4141

42+
An `Example` containing an untyped `ExampleSpec` uses the Repository type and its collection name. Typed `ExampleSpec` use their type as result type and the collection name from the Repository.
43+
4244
NOTE: When including `null` values in the `ExampleSpec` Spring Data Mongo uses embedded document matching instead of dot notation property matching. This forces exact document matching for all property values and the property order in the embedded document.
4345

4446
Spring Data MongoDB provides support for the following matching options:

0 commit comments

Comments
 (0)