com.holonplatform.datastore.mongo.core

## Interface MongoDatabaseHandler<MongoDatabase>

- Type Parameters:
    `MongoDatabase` - Actual MongoDatabase type (sync or async)
  All Known Subinterfaces:
    AsyncMongoDatastore, AsyncMongoDatastoreCommodityContext, BaseAsyncMongoDatastore, MongoDatastore, MongoDatastoreCommodityContext<MongoDatabase,S>, MongoOperationContext<MongoDatabase,S>, ReactiveMongoDatastore, SyncMongoDatastoreCommodityContext
  All Known Implementing Classes:
    AbstractAsyncMongoDatastore, com.holonplatform.datastore.mongo.core.internal.datastore.AbstractMongoDatastore, DefaultAsyncMongoDatastore, DefaultMongoDatastore, DefaultReactiveMongoDatastore

      public interface MongoDatabaseHandler<MongoDatabase>

  Mongo Database handler.
  Since:
    5.2.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `<R> R` | `withDatabase(MongoDatabaseOperation<MongoDatabase,R> operation)` Execute given `MongoDatabaseOperation` using a managed MongoDatabase.
    `default void` | `withDatabase(MongoDatabaseRunnable<MongoDatabase> operation)` Execute given `MongoDatabaseRunnable` operation using a managed MongoDatabase.

- - ### Method Detail

    - #### withDatabase

          <R> R withDatabase(MongoDatabaseOperation<MongoDatabase,R> operation)

      Execute given `MongoDatabaseOperation` using a managed MongoDatabase.
      Type Parameters:
        `R` - Operation result type
      Parameters:
        `operation` - Operation to execute (not null)
      Returns:
        Operation result

    - #### withDatabase

          default void withDatabase(MongoDatabaseRunnable<MongoDatabase> operation)

      Execute given `MongoDatabaseRunnable` operation using a managed MongoDatabase.
      Parameters:
        `operation` - Operation to execute (not null)

Copyright © 2019 The Holon Platform. All rights reserved.