Enum MergeOptions.WhenNotMatched

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MergeOptions.WhenNotMatched>
    Enclosing class:
    MergeOptions

    public static enum MergeOptions.WhenNotMatched
    extends java.lang.Enum<MergeOptions.WhenNotMatched>
    The behavior of $merge if a result document does not match an existing document in the out collection.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DISCARD
      Discard the document; i.e.
      FAIL
      Stop and fail the aggregation operation.
      INSERT
      Insert the document into the output collection.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MergeOptions.WhenNotMatched valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MergeOptions.WhenNotMatched[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DISCARD

        public static final MergeOptions.WhenNotMatched DISCARD
        Discard the document; i.e. $merge does not insert the document into the output collection.
      • FAIL

        public static final MergeOptions.WhenNotMatched FAIL
        Stop and fail the aggregation operation. Any changes to the output collection from previous documents are not reverted.
    • Method Detail

      • values

        public static MergeOptions.WhenNotMatched[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MergeOptions.WhenNotMatched c : MergeOptions.WhenNotMatched.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MergeOptions.WhenNotMatched valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null