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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisUpsert()Get the bit indicating if to create a new document if not exists.static ReplaceOptionsnone()Static factory method returning an unmodifiableReplaceOptionsinstance.static ReplaceOptionsStatic factory method to create aReplaceOptionsinstance.upsert()Insert a new document if not exists.
-
Constructor Details
-
ReplaceOptions
public ReplaceOptions()
-
-
Method Details
-
replaceOptions
Static factory method to create aReplaceOptionsinstance.- upsert
- false
- Returns:
- new instance of
ReplaceOptions.
-
none
Static factory method returning an unmodifiableReplaceOptionsinstance.- Returns:
- unmodifiable
ReplaceOptionsinstance.
-
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.
-