Skip to content

Instantly share code, notes, and snippets.

@timjonesdev
Created August 20, 2019 22:07
Show Gist options
  • Select an option

  • Save timjonesdev/cbdb2a072104d42804bbdb40fecb7ad0 to your computer and use it in GitHub Desktop.

Select an option

Save timjonesdev/cbdb2a072104d42804bbdb40fecb7ad0 to your computer and use it in GitHub Desktop.
Team Reactive Mongo Repository for Reactive Mongo Example
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