com.holonplatform.datastore.mongo.core

## Interface MongoDatastoreBuilder<D extends com.holonplatform.core.datastore.DatastoreOperations,S extends com.mongodb.session.ClientSession,TX extends MongoTransaction<S>,B extends MongoDatastoreBuilder<D,S,TX,B>>

- Type Parameters:
    `D` - `DatastoreOperations` type
    `S` - Concrete client session type
    `TX` - Concrete transaction type
    `B` - Concrete builder type
  All Superinterfaces:
    com.holonplatform.core.datastore.DatastoreOperations.Builder<D,B>, com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<B>
  All Known Subinterfaces:
    AsyncMongoDatastore.Builder, BaseAsyncMongoDatastore.Builder<D,TX,B>, MongoDatastore.Builder, ReactiveMongoDatastore.Builder
  All Known Implementing Classes:
    AbstractAsyncMongoDatastore.AsyncBuilder, com.holonplatform.datastore.mongo.core.internal.datastore.AbstractMongoDatastore.AbstractBuilder, DefaultAsyncMongoDatastore.DefaultBuilder, DefaultMongoDatastore.DefaultBuilder, DefaultReactiveMongoDatastore.DefaultBuilder

      public interface MongoDatastoreBuilder<D extends com.holonplatform.core.datastore.DatastoreOperations,S extends com.mongodb.session.ClientSession,TX extends MongoTransaction<S>,B extends MongoDatastoreBuilder<D,S,TX,B>>
      extends com.holonplatform.core.datastore.DatastoreOperations.Builder<D,B>

  Base MongoDB Datastore builder.
  Since:
    5.2.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `B` | `database(String database)` Set the database name to use.
    `B` | `enumCodecStrategy(EnumCodecStrategy enumCodecStrategy)` Set the default `EnumCodecStrategy` to use when encoding and decoding `Enum` type values.
    `B` | `readConcern(com.mongodb.ReadConcern readConcern)` Set the default `ReadConcern` to declare the read operations isolation level.
    `B` | `readPreference(com.mongodb.ReadPreference readPreference)` Set the default `ReadPreference` for query or data read operations.
    `B` | `transactionFactory(MongoTransactionFactory<S,TX> transactionFactory)` Set the `MongoTransactionFactory` to use to provide `MongoTransaction` implementations.
    `B` | `withCodec(org.bson.codecs.Codec<?> codec)` Add a `Codec` to be registered in the default Mongo Datastore codec registry.
    `B` | `withCodecProvider(org.bson.codecs.configuration.CodecProvider codecProvider)` Add a `CodecProvider` to be registered in the default Mongo Datastore codec registry.
    `B` | `writeConcern(com.mongodb.WriteConcern writeConcern)` Set the default acknowledgment of write operations.

    - ### Methods inherited from interface com.holonplatform.core.datastore.DatastoreOperations.Builder

      `build, configuration, dataContextId, traceEnabled`

    - ### Methods inherited from interface com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder

      `withExpressionResolver`

- - ### Method Detail

    - #### database

          B database(String database)

      Set the database name to use.
      Parameters:
        `database` - The database name to set (not null)
      Returns:
        this

    - #### withCodec

          B withCodec(org.bson.codecs.Codec<?> codec)

      Add a `Codec` to be registered in the default Mongo Datastore codec registry.

      The `Codec` will be available to encode/decode values for the database managed by the Mongo Datastore instance.

      Parameters:
        `codec` - The `Codec` to add (not null)
      Returns:
        this

    - #### withCodecProvider

          B withCodecProvider(org.bson.codecs.configuration.CodecProvider codecProvider)

      Add a `CodecProvider` to be registered in the default Mongo Datastore codec registry.

      The `CodecProvider` will be available to encode/decode values for the database managed by the Mongo Datastore instance.

      Parameters:
        `codecProvider` - The `CodecProvider` to add (not null)
      Returns:
        this

    - #### readPreference

          B readPreference(com.mongodb.ReadPreference readPreference)

      Set the default `ReadPreference` for query or data read operations.
      Parameters:
        `readPreference` - Default `ReadPreference` to use (not null)
      Returns:
        this

    - #### readConcern

          B readConcern(com.mongodb.ReadConcern readConcern)

      Set the default `ReadConcern` to declare the read operations isolation level.
      Parameters:
        `readConcern` - Default `ReadConcern` to use (not null)
      Returns:
        this

    - #### writeConcern

          B writeConcern(com.mongodb.WriteConcern writeConcern)

      Set the default acknowledgment of write operations.
      Parameters:
        `writeConcern` - Default `WriteConcern` to use (not null)
      Returns:
        this

    - #### enumCodecStrategy

          B enumCodecStrategy(EnumCodecStrategy enumCodecStrategy)

      Set the default `EnumCodecStrategy` to use when encoding and decoding `Enum` type values.
      Parameters:
        `enumCodecStrategy` - The default EnumCodecStrategy to set
      Returns:
        this

    - #### transactionFactory

          B transactionFactory(MongoTransactionFactory<S,TX> transactionFactory)

      Set the `MongoTransactionFactory` to use to provide `MongoTransaction` implementations.
      Parameters:
        `transactionFactory` - The transaction factory to set (not null)
      Returns:
        this

Copyright © 2019 The Holon Platform. All rights reserved.