Enum Class FullDocumentBeforeChange

java.lang.Object
java.lang.Enum<FullDocumentBeforeChange>
com.mongodb.client.model.changestream.FullDocumentBeforeChange
All Implemented Interfaces:
Serializable, Comparable<FullDocumentBeforeChange>, java.lang.constant.Constable

public enum FullDocumentBeforeChange extends Enum<FullDocumentBeforeChange>
Change Stream fullDocumentBeforeChange configuration.

Determines what to return for update operations when using a Change Stream. Defaults to DEFAULT.

Since:
4.7
Since server release
6.0
  • Enum Constant Details

    • DEFAULT

      public static final FullDocumentBeforeChange DEFAULT
      The default value
    • OFF

      public static final FullDocumentBeforeChange OFF
      Configures the change stream to not include the pre-image of the modified document.
    • WHEN_AVAILABLE

      public static final FullDocumentBeforeChange WHEN_AVAILABLE
      Configures the change stream to return the pre-image of the modified document for replace, update, and delete change events if it is available.
    • REQUIRED

      public static final FullDocumentBeforeChange REQUIRED
      The same behavior as WHEN_AVAILABLE except that an error is raised by the server if the pre-image is not available.
  • Method Details

    • values

      public static FullDocumentBeforeChange[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FullDocumentBeforeChange valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      The string value.
      Returns:
      the string value
    • fromString

      public static FullDocumentBeforeChange fromString(String value)
      Returns the FullDocumentBeforeChange from the string value.
      Parameters:
      value - the string value.
      Returns:
      the full document before change