@Beta public enum WriteMode extends Enum<WriteMode>
Enum Constant and Description |
---|
INSERT_ONLY
Items will be inserted to MongoDB; in case of ID clash, error will be thrown.
|
REPLACE
Performs replace.
|
UPDATE_ONLY
Performs update.
|
UPSERT
Performs update.
|
Modifier and Type | Method and Description |
---|---|
static WriteMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static WriteMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final WriteMode INSERT_ONLY
public static final WriteMode UPDATE_ONLY
_id
must already exist, otherwise an error will be thrown.public static final WriteMode UPSERT
_id
does not exist, it will be created.public static final WriteMode REPLACE
_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.
public static WriteMode[] values()
for (WriteMode c : WriteMode.values()) System.out.println(c);
public static WriteMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2023 Hazelcast, Inc.. All rights reserved.