Object

org.mongodb.scala

WriteConcern

Related Doc: package scala

Permalink

object WriteConcern

Controls the acknowledgment of write operations with various options.

w

- 0: Don't wait for acknowledgement from the server - 1: Wait for acknowledgement, but don't wait for secondaries to replicate - >=2: Wait for one or more secondaries to also acknowledge - "majority": Wait for a majority of secondaries to also acknowledge - "<tag set name>": Wait for one or more secondaries to also acknowledge based on a tag set name

wTimeout - how long to wait for slaves before failing

- 0: indefinite - >0: time to wait in milliseconds

Other options:

- journal: If true block until write operations have been committed to the journal. Cannot be used in combination with fsync. Prior to MongoDB 2.6 this option was ignored if the server was running without journaling. Starting with MongoDB 2.6 write operations will fail with an exception if this option is used when the server is running without journaling.

Implicit helper

The ScalaWriteConcern implicit allows for chainable building of the WriteConcern eg:

val myWriteConcern = WriteConcern.ACKNOWLEDGED.withJournal(true)).withWTimeout(Duration(10, TimeUnit.MILLISECONDS))

Since

1.0

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. WriteConcern
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val ACKNOWLEDGED: com.mongodb.WriteConcern

    Permalink

    Write operations that use this write concern will wait for acknowledgement from the primary server before returning.

    Write operations that use this write concern will wait for acknowledgement from the primary server before returning. Exceptions are raised for network issues, and server errors.

  5. val JOURNALED: com.mongodb.WriteConcern

    Permalink

    Exceptions are raised for network issues, and server errors; the write operation waits for the server to group commit to the journal file on disk.

  6. val MAJORITY: com.mongodb.WriteConcern

    Permalink

    Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation.

  7. val UNACKNOWLEDGED: com.mongodb.WriteConcern

    Permalink

    Write operations that use this write concern will return as soon as the message is written to the socket.

    Write operations that use this write concern will return as soon as the message is written to the socket. Exceptions are raised for network issues, but not server errors.

  8. val W1: com.mongodb.WriteConcern

    Permalink

    Write operations that use this write concern will wait for acknowledgement from a single member.

  9. val W2: com.mongodb.WriteConcern

    Permalink

    Write operations that use this write concern will wait for acknowledgement from two members.

  10. val W3: com.mongodb.WriteConcern

    Permalink

    Write operations that use this write concern will wait for acknowledgement from three members.

  11. def apply(w: String): com.mongodb.WriteConcern

    Permalink

    Tag set named write concern or a "majority" write concern.

    Tag set named write concern or a "majority" write concern.

    w

    Write Concern tag set name or "majority", representing the servers to ensure write propagation to before acknowledgment. Do not use string representation of integer values for w.

  12. def apply(w: Int): com.mongodb.WriteConcern

    Permalink

    Create a WriteConcern with the set number of acknowledged writes before returning

    Create a WriteConcern with the set number of acknowledged writes before returning

    w

    number of writes

  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped