Package dev.morphia
Class ModifyOptions
- java.lang.Object
-
- com.mongodb.client.model.FindOneAndUpdateOptions
-
- dev.morphia.ModifyOptions
-
- All Implemented Interfaces:
dev.morphia.internal.CollectionConfigurable<ModifyOptions>
,dev.morphia.internal.CollectionConfiguration
,dev.morphia.internal.WriteConfigurable<ModifyOptions>
- Direct Known Subclasses:
FindAndModifyOptions
public class ModifyOptions extends FindOneAndUpdateOptions implements dev.morphia.internal.WriteConfigurable<ModifyOptions>, dev.morphia.internal.CollectionConfigurable<ModifyOptions>
Defines the options for a "find and modify" operation.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description ModifyOptions()
-
Method Summary
-
Methods inherited from class com.mongodb.client.model.FindOneAndUpdateOptions
getArrayFilters, getBypassDocumentValidation, getCollation, getComment, getHint, getHintString, getLet, getMaxTime, getProjection, getReturnDocument, getSort, isUpsert, toString
-
-
-
-
Method Detail
-
collection
public ModifyOptions collection(String collection)
Sets the alternate collection to use for the operation.- Specified by:
collection
in interfacedev.morphia.internal.CollectionConfigurable<ModifyOptions>
- Parameters:
collection
- the name of the collection to use- Returns:
- this
-
collection
public String collection()
Returns the alternate collection to use for the operation. Might return null.- Specified by:
collection
in interfacedev.morphia.internal.CollectionConfigurable<ModifyOptions>
- Returns:
- the collection name or null
-
hint
public ModifyOptions hint(Document hint)
- Parameters:
hint
- the hint to apply- Returns:
- this
- Since:
- 2.2
- See Also:
hint(Bson)
-
projection
public ModifyOptions projection(@Nullable Bson projection)
- Overrides:
projection
in classFindOneAndUpdateOptions
-
sort
public ModifyOptions sort(@Nullable Bson sort)
- Overrides:
sort
in classFindOneAndUpdateOptions
-
upsert
public ModifyOptions upsert(boolean upsert)
- Overrides:
upsert
in classFindOneAndUpdateOptions
-
returnDocument
public ModifyOptions returnDocument(ReturnDocument returnDocument)
- Overrides:
returnDocument
in classFindOneAndUpdateOptions
-
maxTime
public ModifyOptions maxTime(long maxTime, TimeUnit timeUnit)
- Overrides:
maxTime
in classFindOneAndUpdateOptions
-
bypassDocumentValidation
public ModifyOptions bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation)
- Overrides:
bypassDocumentValidation
in classFindOneAndUpdateOptions
-
collation
public ModifyOptions collation(@Nullable Collation collation)
- Overrides:
collation
in classFindOneAndUpdateOptions
-
arrayFilters
public ModifyOptions arrayFilters(@Nullable List<? extends Bson> arrayFilters)
- Overrides:
arrayFilters
in classFindOneAndUpdateOptions
-
hint
public ModifyOptions hint(@Nullable Bson hint)
- Overrides:
hint
in classFindOneAndUpdateOptions
- Since:
- 2.2
- See Also:
FindOneAndUpdateOptions.hint(Bson)
-
hintString
public ModifyOptions hintString(@Nullable String hint)
- Overrides:
hintString
in classFindOneAndUpdateOptions
- Returns:
- this
- Since:
- 2.2
- See Also:
FindOneAndUpdateOptions.hintString(String)
-
comment
public ModifyOptions comment(String comment)
- Overrides:
comment
in classFindOneAndUpdateOptions
- Returns:
- this
- Since:
- 2.3
-
comment
public ModifyOptions comment(BsonValue comment)
- Overrides:
comment
in classFindOneAndUpdateOptions
- Returns:
- this
- Since:
- 2.3
-
let
public ModifyOptions let(Bson variables)
- Overrides:
let
in classFindOneAndUpdateOptions
- Returns:
- this
- Since:
- 2.3
-
writeConcern
public ModifyOptions writeConcern(@Nullable WriteConcern writeConcern)
Description copied from interface:dev.morphia.internal.WriteConfigurable
Set the write concern to use.- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<ModifyOptions>
- Parameters:
writeConcern
- the write concern- Returns:
- this
-
writeConcern
@Nullable public WriteConcern writeConcern()
Description copied from interface:dev.morphia.internal.WriteConfigurable
The write concern to use. By default the write concern configured for the MongoCollection instance will be used.- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<ModifyOptions>
- Returns:
- the write concern to use
-
-