3. Cover w/ Image
Agenda
● Newman Release (May 2020)
● 2020.0 (expected end Oct 2020)
codename Ockham
org.springframework.data
spring-data-releasetrain
Neumann-SR3
CUR
org.springframework.data
spring-data-bom
2020.0.0-M2
PRE
org.springframework.data
spring-data-mongodb
3.1.0-M2
PRE
4. Spring Data MongoDB 3.0 (Neumann)
Major version upgrade with some breaking changes
● Driver upgrades to 4.0
● Indexing Updates
● Updates via Aggregation pipeline
● Reactive GridFS changes
● Convenience
org.springframework.data
spring-data-mongodb
3.0.3
CUR
7. 3.0 – Driver Upgrades
Configuration Changes – What it was like in 2.x
AbstractMongoConfiguration (2.x)
@Configuration
class Cfg extends AbstractMongoConfiguration {
@Override
protected String getDatabaseName() {
return "database";
}
@Override
public com.mongodb.MongoClient mongoClient() {
return new com.mongodb.MongoClient();
}
}
15. 3.0 – Reactive GridFS
Flux<DataBuffer> source = ...
gridFSops.store(source, “springone", "binary/octet-stream", metadata);
public class ReactiveGridFsResource {
public Mono<GridFSFile> getGridFSFile() {
!!...
}
}
public Flux<DataBuffer> getContent() {
... // via GridFSDownloadPublisher
}
ReactiveGridFsResource s1p = gridFSops.getResources("s1p");
3.0
16. 3.0 – Convenience
...somtimes it’s the small things
query(where("name")...)
.withHint(
new Document("att1", 1).append("att2", 1)
)
@Sharded
public class Person {
private @Id String id;
private String firstname;
}
Shard Support
template.query(Person.class)
.matching(where("firstname").is("luke"))
.one()
Narrow API
query(where("name")!!...).withHint("index-name")
Index Hints (via name)
template.query(Person.class)
.matching(query(where("firstname").is("luke")))
.one()
17. Spring Data MongoDB 3.1 (2020.0)
Closing gaps to the imperative implementation.
● Reactive SpEL in @Query annotations
● Reactive Auditing
● Repository Metrics
● GraalVM Native Image experience
● Read Only Transactions
codename: Ockham
The following section is intended to outline the general direction
of VMware's offerings. It is intended for information purposes
only and may not be incorporated into any contract. Any
information regarding pre-release of VMware offerings, future
updates or other planned modifications is subject to ongoing
evaluation by VMware and is subject to change. This information
is provided without warranty or any kind, express or implied, and
is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making
purchasing decisions regarding VMware's offerings. These
purchasing decisions should only be based on features currently
available. The development, release, and timing of any features
or functionality described for VMware's offerings in this
presentation remain at the sole discretion of VMware. VMware
has no obligation to update forward looking information in this
presentation.
org.springframework.data
spring-data-mongodb
3.1.0-M2
PRE
18. @Query("{ 'supervisor' : ?#{ hasRole('ROLE_ADMIN') ? new Document('$regex', '*') : principal.name } }")
Flux<Person> findAllFilteredByRole();
3.1 – Reactive SpEL
now truly reactive via ReactiveEvaluationContextExtension
Flux<Person> all = repo.findAllFilteredByRole();
all.subscribe();
2.x
⚡
3.1
👍