Browse Source

Polishing.

Refine documentation links.

See #5028
pull/5044/head
Mark Paluch 4 months ago
parent
commit
e3af5c49f5
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 10
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java
  2. 18
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java
  3. 6
      src/main/antora/modules/ROOT/pages/mongodb/mongo-group.adoc
  4. 2
      src/main/antora/modules/ROOT/pages/mongodb/template-gridfs.adoc
  5. 9
      src/main/antora/resources/antora-resources/antora.yml

10
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java

@ -1426,8 +1426,8 @@ public interface MongoOperations extends FluentMongoOperations { @@ -1426,8 +1426,8 @@ public interface MongoOperations extends FluentMongoOperations {
* 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 />
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">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
* {@link #save(Object)} method.
* <p>
@ -1514,8 +1514,8 @@ public interface MongoOperations extends FluentMongoOperations { @@ -1514,8 +1514,8 @@ public interface MongoOperations extends FluentMongoOperations {
* 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
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
* Type Conversion"</a> for more details.
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">Spring's Type
* Conversion</a> for more details.
* <p>
* A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
* operation raises an error in case the document has been modified in between.
@ -1540,7 +1540,7 @@ public interface MongoOperations extends FluentMongoOperations { @@ -1540,7 +1540,7 @@ public interface MongoOperations extends FluentMongoOperations {
* 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
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation">Spring's Type
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">Spring's Type
* Conversion</a> for more details.
* <p>
* A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The

18
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java

@ -1237,8 +1237,8 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -1237,8 +1237,8 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
* 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 />
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">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.
* <p>
* Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
@ -1322,8 +1322,8 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -1322,8 +1322,8 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
* 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
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
* Type Conversion"</a> for more details. <br />
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">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.
* <p>
* A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
@ -1386,8 +1386,8 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -1386,8 +1386,8 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
* 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
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
* Type Conversion"</a> for more details.
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">Spring's Type
* Conversion</a> for more details.
* <p>
* A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
* operation raises an error in case the document has been modified in between.
@ -1412,7 +1412,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -1412,7 +1412,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
* 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
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation">Spring's Type
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">Spring's Type
* Conversion</a> for more details.
* <p>
* A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
@ -1435,7 +1435,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -1435,7 +1435,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
* 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
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation"> Spring's Type
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">Spring's Type
* Conversion</a> for more details.
* <p>
* A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
@ -1458,7 +1458,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations { @@ -1458,7 +1458,7 @@ public interface ReactiveMongoOperations extends ReactiveFluentMongoOperations {
* 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
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation">Spring's Type
* <a href="https://docs.spring.io/spring-framework/reference/core/validation/convert.html">Spring's Type
* Conversion</a> for more details.
* <p>
* A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The

6
src/main/antora/modules/ROOT/pages/mongodb/mongo-group.adoc

@ -3,7 +3,11 @@ @@ -3,7 +3,11 @@
As an alternative to using Map-Reduce to perform data aggregation, you can use the https://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Group[`group` operation] which feels similar to using SQL's group by query style, so it may feel more approachable vs. using Map-Reduce. Using the group operations does have some limitations, for example it is not supported in a shared environment and it returns the full result set in a single BSON object, so the result should be small, less than 10,000 keys.
Spring provides integration with MongoDB's group operation by providing methods on MongoOperations to simplify the creation and running of group operations. It can convert the results of the group operation to a POJO and also integrates with Spring's https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#resources[Resource abstraction] abstraction. This will let you place your JavaScript files on the file system, classpath, http server or any other Spring Resource implementation and then reference the JavaScript resources via an easy URI style syntax, e.g. 'classpath:reduce.js;. Externalizing JavaScript code in files if often preferable to embedding them as Java strings in your code. Note that you can still pass JavaScript code as Java strings if you prefer.
Spring provides integration with MongoDB's group operation by providing methods on MongoOperations to simplify the creation and running of group operations.
It can convert the results of the group operation to a POJO and also integrates with Spring's {spring-framework-docs}/core/resources.html[Resource abstraction] abstraction.
This will let you place your JavaScript files on the file system, classpath, http server or any other Spring Resource implementation and then reference the JavaScript resources via an easy URI style syntax, e.g. 'classpath:reduce.js;.
Externalizing JavaScript code in files if often preferable to embedding them as Java strings in your code.
Note that you can still pass JavaScript code as Java strings if you prefer.
[[mongo.group.example]]
== Example Usage

2
src/main/antora/modules/ROOT/pages/mongodb/template-gridfs.adoc

@ -120,7 +120,7 @@ Alternatively, you can also provide a `Document`. @@ -120,7 +120,7 @@ Alternatively, you can also provide a `Document`.
The MongoDB's driver uses `AsyncInputStream` and `AsyncOutputStream` interfaces to exchange binary streams.
Spring Data MongoDB adapts these interfaces to `Publisher<DataBuffer>`.
Read more about `DataBuffer` in https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#databuffers[Spring's reference documentation].
Read more about `DataBuffer` in {spring-framework-docs}/core/databuffer-codec.html[Spring's reference documentation].
====
======

9
src/main/antora/resources/antora-resources/antora.yml

@ -3,18 +3,19 @@ prerelease: ${antora-component.prerelease} @@ -3,18 +3,19 @@ prerelease: ${antora-component.prerelease}
asciidoc:
attributes:
attribute-missing: 'warn'
chomp: 'all'
version: ${project.version}
copyright-year: ${current.year}
springversionshort: ${spring.short}
springversion: ${spring}
attribute-missing: 'warn'
commons: ${springdata.commons.docs}
include-xml-namespaces: false
spring-data-commons-docs-url: https://docs.spring.io/spring-data/commons/reference
spring-data-commons-javadoc-base: https://docs.spring.io/spring-data/commons/docs/${springdata.commons}/api/
spring-data-commons-docs-url: https://docs.spring.io/spring-data/commons/reference/{commons}
spring-data-commons-javadoc-base: '{spring-data-commons-docs-url}/api/java'
springdocsurl: https://docs.spring.io/spring-framework/reference/{springversionshort}
springjavadocurl: https://docs.spring.io/spring-framework/docs/${spring}/javadoc-api
spring-framework-docs: '{springdocsurl}'
springjavadocurl: https://docs.spring.io/spring-framework/docs/${spring}/javadoc-api
spring-framework-javadoc: '{springjavadocurl}'
springhateoasversion: ${spring-hateoas}
releasetrainversion: ${releasetrain}

Loading…
Cancel
Save