Created
August 20, 2019 22:07
-
-
Save timjonesdev/cbdb2a072104d42804bbdb40fecb7ad0 to your computer and use it in GitHub Desktop.
Team Reactive Mongo Repository for Reactive Mongo Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dev.timjones.reactive.data.model.Team; | |
| import org.bson.types.ObjectId; | |
| import org.springframework.data.mongodb.repository.Query; | |
| import org.springframework.data.mongodb.repository.ReactiveMongoRepository; | |
| import reactor.core.publisher.Mono; | |
| public interface TeamRepository extends ReactiveMongoRepository<Team, ObjectId> { | |
| @Query(value = "{ 'players.name' : ?0 }") | |
| Mono<Team> findDistinctByPlayerName(String playerName); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment