Package dev.morphia
Class ReplaceOptions
- java.lang.Object
-
- com.mongodb.client.model.ReplaceOptions
-
- dev.morphia.ReplaceOptions
-
- All Implemented Interfaces:
dev.morphia.internal.CollectionConfiguration
,dev.morphia.internal.WriteConfigurable<ReplaceOptions>
public class ReplaceOptions extends ReplaceOptions implements dev.morphia.internal.WriteConfigurable<ReplaceOptions>
Options related to insertion of documents into MongoDB. The setter methods returnthis
so that a chaining style can be used.- Since:
- 2.3
-
-
Constructor Summary
Constructors Constructor Description ReplaceOptions()
Creates a new options wrapper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReplaceOptions
bypassDocumentValidation(Boolean bypassDocumentValidation)
Sets whether to bypass document validation.ReplaceOptions
collation(Collation collation)
ReplaceOptions
comment(String comment)
ReplaceOptions
comment(BsonValue comment)
ReplaceOptions
hint(Bson hint)
ReplaceOptions
hintString(String hint)
ReplaceOptions
let(Bson variables)
ReplaceOptions
upsert(boolean upsert)
WriteConcern
writeConcern()
The write concern to use for the insertion.ReplaceOptions
writeConcern(WriteConcern writeConcern)
Sets the write concern to use for the insert.-
Methods inherited from class com.mongodb.client.model.ReplaceOptions
getBypassDocumentValidation, getCollation, getComment, getHint, getHintString, getLet, isUpsert, toString
-
-
-
-
Method Detail
-
upsert
public ReplaceOptions upsert(boolean upsert)
- Overrides:
upsert
in classReplaceOptions
-
bypassDocumentValidation
public ReplaceOptions bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
Sets whether to bypass document validation.- Overrides:
bypassDocumentValidation
in classReplaceOptions
- Parameters:
bypassDocumentValidation
- whether to bypass document validation, or null if unspecified- Returns:
- this
- Since server release
- 3.2
-
collation
public ReplaceOptions collation(@Nullable Collation collation)
- Overrides:
collation
in classReplaceOptions
-
hint
public ReplaceOptions hint(@Nullable Bson hint)
- Overrides:
hint
in classReplaceOptions
-
hintString
public ReplaceOptions hintString(@Nullable String hint)
- Overrides:
hintString
in classReplaceOptions
-
comment
public ReplaceOptions comment(@Nullable String comment)
- Overrides:
comment
in classReplaceOptions
- Parameters:
comment
- the comment- Returns:
- this
- See Also:
ReplaceOptions.comment(String)
-
comment
public ReplaceOptions comment(@Nullable BsonValue comment)
- Overrides:
comment
in classReplaceOptions
- Parameters:
comment
- the comment- Returns:
- this
- See Also:
ReplaceOptions.comment(BsonValue)
-
let
public ReplaceOptions let(Bson variables)
- Overrides:
let
in classReplaceOptions
-
writeConcern
public ReplaceOptions writeConcern(@Nullable WriteConcern writeConcern)
Sets the write concern to use for the insert.- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<ReplaceOptions>
- Parameters:
writeConcern
- the write concern- Returns:
- this
-
writeConcern
@Nullable public WriteConcern writeConcern()
The write concern to use for the insertion. By default, the write concern configured for the MongoCollection instance will be used.- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<ReplaceOptions>
- Returns:
- the write concern or null if the default will be used.
-
-