Enum Class WriteMode

java.lang.Object
java.lang.Enum<WriteMode>
com.hazelcast.jet.mongodb.WriteMode
All Implemented Interfaces:
Serializable, Comparable<WriteMode>, Constable

public enum WriteMode extends Enum<WriteMode>
Defines allowed operations.
Since:
5.3
  • Enum Constant Details

    • INSERT_ONLY

      public static final WriteMode INSERT_ONLY
      Items will be inserted to MongoDB; in case of ID clash, error will be thrown.
    • UPDATE_ONLY

      public static final WriteMode UPDATE_ONLY
      Performs update. Entity with the given _id must already exist, otherwise an error will be thrown.
    • UPSERT

      public static final WriteMode UPSERT
      Performs update. If the entity with the given _id does not exist, it will be created.
    • REPLACE

      public static final WriteMode REPLACE
      Performs replace. If the entity with the given _id does not exist, it will be created (if it was not overridden by the user).

      Replace is different from UPSERT in handling of missing fields. Replace will set them to null, while upsert won't affect such fields in the entity.

  • Method Details

    • values

      public static WriteMode[] 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 WriteMode 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