org.springframework.data.mongodb

Interface ReactiveMongoDatabaseFactory

    • Method Detail

      • getMongoDatabase

        com.mongodb.reactivestreams.client.MongoDatabase getMongoDatabase()
                                                                   throws DataAccessException
        Creates a default MongoDatabase instance.
        Returns:
        Throws:
        DataAccessException
      • getMongoDatabase

        com.mongodb.reactivestreams.client.MongoDatabase getMongoDatabase(String dbName)
                                                                   throws DataAccessException
        Creates a MongoDatabase instance to access the database with the given name.
        Parameters:
        dbName - must not be null or empty.
        Returns:
        Throws:
        DataAccessException
      • getCodecRegistry

        default org.bson.codecs.configuration.CodecRegistry getCodecRegistry()
        Get the underlying CodecRegistry used by the reactive MongoDB Java driver.
        Specified by:
        getCodecRegistry in interface CodecRegistryProvider
        Returns:
        never null.
      • getSession

        reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.ClientSession> getSession(com.mongodb.ClientSessionOptions options)
        Obtain a Mono emitting a ClientSession for given options.
        Parameters:
        options - must not be null.
        Returns:
        never null.
        Since:
        2.1
      • withSession

        ReactiveMongoDatabaseFactory withSession(com.mongodb.reactivestreams.client.ClientSession session)
        Obtain a ClientSession bound instance of ReactiveMongoDatabaseFactory returning MongoDatabase instances that are aware and bound to the given session.
        Parameters:
        session - must not be null.
        Returns:
        never null.
        Since:
        2.1