Class ReplaceOptions
java.lang.Object
org.springframework.data.mongodb.core.ReplaceOptions
- Direct Known Subclasses:
FindAndReplaceOptions
Options for
replace operations
. Defaults to
- upsert
- false
- Since:
- 4.2
- Author:
- Jakub Zurawa, Christoph Strob
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isUpsert()
Get the bit indicating if to create a new document if not exists.static ReplaceOptions
none()
Static factory method returning an unmodifiableReplaceOptions
instance.static ReplaceOptions
Static factory method to create aReplaceOptions
instance.upsert()
Insert a new document if not exists.
-
Constructor Details
-
ReplaceOptions
public ReplaceOptions()
-
-
Method Details
-
replaceOptions
Static factory method to create aReplaceOptions
instance.- upsert
- false
- Returns:
- new instance of
ReplaceOptions
.
-
none
Static factory method returning an unmodifiableReplaceOptions
instance.- Returns:
- unmodifiable
ReplaceOptions
instance.
-
upsert
Insert a new document if not exists.- Returns:
- this.
-
isUpsert
public boolean isUpsert()Get the bit indicating if to create a new document if not exists.- Returns:
- true if set.
-