Interface ReactiveMongoRepository<T,ID>

All Superinterfaces:
org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID>, org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>, org.springframework.data.repository.reactive.ReactiveSortingRepository<T,ID>, org.springframework.data.repository.Repository<T,ID>
All Known Implementing Classes:
SimpleReactiveMongoRepository

@NoRepositoryBean public interface ReactiveMongoRepository<T,ID> extends org.springframework.data.repository.reactive.ReactiveCrudRepository<T,ID>, org.springframework.data.repository.reactive.ReactiveSortingRepository<T,ID>, org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
Mongo specific Repository interface with reactive support.
Since:
2.0
Author:
Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    <S extends T>
    reactor.core.publisher.Flux<S>
    findAll(org.springframework.data.domain.Example<S> example)
    Returns all entities matching the given Example.
    <S extends T>
    reactor.core.publisher.Flux<S>
    findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
    Returns all entities matching the given Example applying the given Sort.
    <S extends T>
    reactor.core.publisher.Flux<S>
    insert(Iterable<S> entities)
    Inserts the given entities.
    <S extends T>
    reactor.core.publisher.Flux<S>
    insert(org.reactivestreams.Publisher<S> entities)
    Inserts the given entities.
    <S extends T>
    reactor.core.publisher.Mono<S>
    insert(S entity)
    Inserts the given entity.

    Methods inherited from interface org.springframework.data.repository.reactive.ReactiveCrudRepository

    count, delete, deleteAll, deleteAll, deleteAll, deleteAllById, deleteById, deleteById, existsById, existsById, findAll, findAllById, findAllById, findById, findById, save, saveAll, saveAll

    Methods inherited from interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor

    count, exists, findBy, findOne

    Methods inherited from interface org.springframework.data.repository.reactive.ReactiveSortingRepository

    findAll
  • Method Details

    • insert

      <S extends T> reactor.core.publisher.Mono<S> insert(S entity)
      Inserts the given entity. Assumes the instance to be new to be able to apply insertion optimizations. Use the returned instance for further operations as the save operation might have changed the entity instance completely. Prefer using ReactiveCrudRepository.save(Object) instead to avoid the usage of store-specific API.
      Parameters:
      entity - must not be null.
      Returns:
      the saved entity
    • insert

      <S extends T> reactor.core.publisher.Flux<S> insert(Iterable<S> entities)
      Inserts the given entities. Assumes the instance to be new to be able to apply insertion optimizations. Use the returned instance for further operations as the save operation might have changed the entity instance completely. Prefer using ReactiveCrudRepository.save(Object) instead to avoid the usage of store-specific API.
      Parameters:
      entities - must not be null.
      Returns:
      the saved entity
    • insert

      <S extends T> reactor.core.publisher.Flux<S> insert(org.reactivestreams.Publisher<S> entities)
      Inserts the given entities. Assumes the instance to be new to be able to apply insertion optimizations. Use the returned instance for further operations as the save operation might have changed the entity instance completely. Prefer using ReactiveCrudRepository.save(Object) instead to avoid the usage of store-specific API.
      Parameters:
      entities - must not be null.
      Returns:
      the saved entity
    • findAll

      <S extends T> reactor.core.publisher.Flux<S> findAll(org.springframework.data.domain.Example<S> example)
      Returns all entities matching the given Example. In case no match could be found an empty Flux is returned.
      By default the Example uses typed matching restricting it to probe assignable types. For example, when sticking with the default type key (_class), the query has restrictions such as _class : { $in : [com.acme.Person] }.
      To avoid the above mentioned type restriction use an UntypedExampleMatcher with Example.of(Object, org.springframework.data.domain.ExampleMatcher).
      Specified by:
      findAll in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
      See Also:
      • ReactiveQueryByExampleExecutor.findAll(org.springframework.data.domain.Example)
    • findAll

      <S extends T> reactor.core.publisher.Flux<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
      Returns all entities matching the given Example applying the given Sort. In case no match could be found an empty Flux is returned.
      By default the Example uses typed matching restricting it to probe assignable types. For example, when sticking with the default type key (_class), the query has restrictions such as _class : { $in : [com.acme.Person] }.
      To avoid the above mentioned type restriction use an UntypedExampleMatcher with Example.of(Object, org.springframework.data.domain.ExampleMatcher).
      Specified by:
      findAll in interface org.springframework.data.repository.query.ReactiveQueryByExampleExecutor<T>
      See Also:
      • ReactiveQueryByExampleExecutor.findAll(org.springframework.data.domain.Example, org.springframework.data.domain.Sort)