Interface WriteConcernConfig


public interface WriteConcernConfig
Configures the write concern.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Configures the journal writing aspect.
    boolean
    If set to true, the driver will retry supported write operations if they fail due to a network error.
    boolean
    Configures the safety.
    w()
    When set, the driver adds w: wValue to all write commands.
    When set, the driver adds wtimeout : ms to all write commands.
  • Method Details

    • safe

      @WithDefault("true") boolean safe()
      Configures the safety. If set to true: the driver ensures that all writes are acknowledged by the MongoDB server, or else throws an exception. (see also w and wtimeoutMS). If set fo
    • false: the driver does not ensure that all writes are acknowledged by the MongoDB server.
    • journal

      @WithDefault("true") boolean journal()
      Configures the journal writing aspect. If set to true: the driver waits for the server to group commit to the journal file on disk. If set to false: the driver does not wait for the server to group commit to the journal file on disk.
    • w

      When set, the driver adds w: wValue to all write commands. It requires safe to be true. The value is typically a number, but can also be the majority string.
    • retryWrites

      @WithDefault("false") boolean retryWrites()
      If set to true, the driver will retry supported write operations if they fail due to a network error.
    • wTimeout

      Optional<Duration> wTimeout()
      When set, the driver adds wtimeout : ms to all write commands. It requires safe to be true.