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

wtimeout - how long to wait for slaves before failing

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

Other options:

- j: 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. - fsync: If true and the server is running without journaling, blocks until the server has synced all data files to disk. If the server is running with journaling, this acts the same as the j option, blocking until write operations have been committed to the journal. Cannot be used in combination with j. In almost all cases the j flag should be used in preference to this one.

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 FSYNCED: com.mongodb.WriteConcern

    Permalink

    Exceptions are raised for network issues, and server errors; the write operation waits for the server to flush the data to disk.

  6. 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.

  7. 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.

  8. object Majority

    Permalink

    A write concern that blocks acknowledgement of a write operation until a majority of replica set members have applied it.

  9. val REPLICA_ACKNOWLEDGED: com.mongodb.WriteConcern

    Permalink

    Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.

  10. 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.

  11. def apply(w: String, wtimeout: Int, fsync: Boolean, j: Boolean): com.mongodb.WriteConcern

    Permalink

    Creates a WriteConcern object, based on a tag name

    Creates a WriteConcern object, based on a tag name

    w

    the tag name

    wtimeout

    timeout for write operation

    fsync

    whether or not to fsync

    j

    whether writes should wait for a journaling group commit

  12. def apply(w: Int, wtimeout: Int, fsync: Boolean, j: Boolean): com.mongodb.WriteConcern

    Permalink

    Creates a WriteConcern object.

    Creates a WriteConcern object.

    Specifies the number of servers to wait for on the write operation, and exception raising behavior

    w represents the number of servers:

    - w=-1 None, no checking is done - w=0 None, network socket errors raised - w=1 Checks server for errors as well as network socket errors raised - w>1 Checks servers (w) for errors as well as network socket errors raised

    w

    number of writes

    wtimeout

    timeout for write operation

    fsync

    whether or not to fsync

    j

    whether writes should wait for a journaling group commit

  13. def apply(w: Int, wtimeout: Int, fsync: Boolean): com.mongodb.WriteConcern

    Permalink

    Creates a WriteConcern object.

    Creates a WriteConcern object.

    Specifies the number of servers to wait for on the write operation, and exception raising behavior

    w represents the number of servers:

    - w=-1 None, no checking is done - w=0 None, network socket errors raised - w=1 Checks server for errors as well as network socket errors raised - w>1 Checks servers (w) for errors as well as network socket errors raised

    w

    number of writes

    wtimeout

    timeout for write operation

    fsync

    whether or not to fsync

  14. def apply(fsync: Boolean): com.mongodb.WriteConcern

    Permalink

    Calls WriteConcern(w: Int, wtimeout: Int, fsync: Boolean) with w=1 and wtimeout=0

    Calls WriteConcern(w: Int, wtimeout: Int, fsync: Boolean) with w=1 and wtimeout=0

    fsync

    whether or not to fsync

  15. def apply(w: Int, wtimeout: Int): com.mongodb.WriteConcern

    Permalink

    Calls WriteConcern(w: Int, wtimeout: Int, fsync: Boolean) with fsync=false

    Calls WriteConcern(w: Int, wtimeout: Int, fsync: Boolean) with fsync=false

    w

    number of writes

    wtimeout

    timeout for write operation

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

    Permalink

    Tag based Write Concern with wtimeout=0, fsync=false, and j=false

    Tag based Write Concern with wtimeout=0, fsync=false, and j=false

    w

    Write Concern tag

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

    Permalink

    Calls WriteConcern(w: Int, wtimeout: Int, fsync: Boolean) with wtimeout=0 and fsync=false

    Calls WriteConcern(w: Int, wtimeout: Int, fsync: Boolean) with wtimeout=0 and fsync=false

    w

    number of writes

  18. def apply(): com.mongodb.WriteConcern

    Permalink

    Default constructor keeping all options as default.

    Default constructor keeping all options as default. Be careful using this constructor, as it's equivalent to WriteConcern.UNACKNOWLEDGED, so writes may be lost without any errors being reported.

    See also

    WriteConcern#UNACKNOWLEDGED

  19. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  27. def majorityWriteConcern(wtimeout: Int, fsync: Boolean, j: Boolean): Majority

    Permalink

    Create a Majority Write Concern that requires a majority of servers to acknowledge the write.

    Create a Majority Write Concern that requires a majority of servers to acknowledge the write.

    wtimeout

    timeout for write operation

    fsync

    whether or not to fsync

    j

    whether writes should wait for a journal group commit

    returns

    Majority, a subclass of WriteConcern that represents the write concern requiring most servers to acknowledge the write

  28. final def ne(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped