Package com.mongodb.client.model
Enum MergeOptions.WhenNotMatched
- java.lang.Object
-
- java.lang.Enum<MergeOptions.WhenNotMatched>
-
- com.mongodb.client.model.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.
-
-
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.
-
-
-
Enum Constant Detail
-
INSERT
public static final MergeOptions.WhenNotMatched INSERT
Insert the document into the output collection.
-
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 namejava.lang.NullPointerException
- if the argument is null
-
-