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 returnthisso 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 ReplaceOptionsbypassDocumentValidation(Boolean bypassDocumentValidation)Sets whether to bypass document validation.ReplaceOptionscollation(Collation collation)ReplaceOptionscomment(String comment)ReplaceOptionscomment(BsonValue comment)ReplaceOptionshint(Bson hint)ReplaceOptionshintString(String hint)ReplaceOptionslet(Bson variables)ReplaceOptionsupsert(boolean upsert)WriteConcernwriteConcern()The write concern to use for the insertion.ReplaceOptionswriteConcern(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:
upsertin classReplaceOptions
-
bypassDocumentValidation
public ReplaceOptions bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
Sets whether to bypass document validation.- Overrides:
bypassDocumentValidationin 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:
collationin classReplaceOptions
-
hint
public ReplaceOptions hint(@Nullable Bson hint)
- Overrides:
hintin classReplaceOptions
-
hintString
public ReplaceOptions hintString(@Nullable String hint)
- Overrides:
hintStringin classReplaceOptions
-
comment
public ReplaceOptions comment(@Nullable String comment)
- Overrides:
commentin classReplaceOptions- Parameters:
comment- the comment- Returns:
- this
- See Also:
ReplaceOptions.comment(String)
-
comment
public ReplaceOptions comment(@Nullable BsonValue comment)
- Overrides:
commentin classReplaceOptions- Parameters:
comment- the comment- Returns:
- this
- See Also:
ReplaceOptions.comment(BsonValue)
-
let
public ReplaceOptions let(Bson variables)
- Overrides:
letin classReplaceOptions
-
writeConcern
public ReplaceOptions writeConcern(@Nullable WriteConcern writeConcern)
Sets the write concern to use for the insert.- Specified by:
writeConcernin 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:
writeConcernin interfacedev.morphia.internal.WriteConfigurable<ReplaceOptions>- Returns:
- the write concern or null if the default will be used.
-
-