Package dev.morphia
Class DeleteOptions
- java.lang.Object
-
- com.mongodb.client.model.DeleteOptions
-
- dev.morphia.DeleteOptions
-
- All Implemented Interfaces:
SessionConfigurable<DeleteOptions>
,WriteConfigurable<DeleteOptions>
public final class DeleteOptions extends com.mongodb.client.model.DeleteOptions implements SessionConfigurable<DeleteOptions>, WriteConfigurable<DeleteOptions>
The options to apply when removing documents from the MongoCollection- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description DeleteOptions()
Creates a new options instanceDeleteOptions(DeleteOptions that)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.mongodb.client.ClientSession
clientSession()
The client session to use for the insertion.DeleteOptions
clientSession(com.mongodb.client.ClientSession clientSession)
Set the client session to use for the insert.DeleteOptions
collation(com.mongodb.client.model.Collation collation)
DeleteOptions
hint(org.bson.conversions.Bson hint)
DeleteOptions
hint(org.bson.Document hint)
DeleteOptions
hintString(String hint)
boolean
isMulti()
DeleteOptions
multi(boolean multi)
com.mongodb.WriteConcern
writeConcern()
The write concern to use for the delete.DeleteOptions
writeConcern(com.mongodb.WriteConcern writeConcern)
Sets the write concern-
Methods inherited from class com.mongodb.client.model.DeleteOptions
getCollation, getHint, getHintString, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface dev.morphia.internal.WriteConfigurable
getWriteConcern, prepare
-
-
-
-
Constructor Detail
-
DeleteOptions
public DeleteOptions()
Creates a new options instance
-
DeleteOptions
public DeleteOptions(DeleteOptions that)
- Parameters:
that
- the options to copy- Since:
- 2.0
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Method Detail
-
clientSession
public DeleteOptions clientSession(@Nullable com.mongodb.client.ClientSession clientSession)
Description copied from interface:SessionConfigurable
Set the client session to use for the insert.- Specified by:
clientSession
in interfaceSessionConfigurable<DeleteOptions>
- Parameters:
clientSession
- the client session- Returns:
- this
-
clientSession
public com.mongodb.client.ClientSession clientSession()
Description copied from interface:SessionConfigurable
The client session to use for the insertion.- Specified by:
clientSession
in interfaceSessionConfigurable<DeleteOptions>
- Returns:
- the client session
-
collation
public DeleteOptions collation(@Nullable com.mongodb.client.model.Collation collation)
- Overrides:
collation
in classcom.mongodb.client.model.DeleteOptions
-
hint
public DeleteOptions hint(@Nullable org.bson.conversions.Bson hint)
- Overrides:
hint
in classcom.mongodb.client.model.DeleteOptions
- Returns:
- this
- Since:
- 2.2
-
hintString
public DeleteOptions hintString(@Nullable String hint)
- Overrides:
hintString
in classcom.mongodb.client.model.DeleteOptions
- Returns:
- this
- Since:
- 2.2
-
hint
public DeleteOptions hint(org.bson.Document hint)
- Parameters:
hint
- the hint to apply- Returns:
- this
- Since:
- 2.2
- See Also:
hint(Bson)
-
isMulti
public boolean isMulti()
- Returns:
- is this delete for multiple documents
-
multi
public DeleteOptions multi(boolean multi)
- Parameters:
multi
- true if this delete should affect multiple documents- Returns:
- this
-
writeConcern
public DeleteOptions writeConcern(@Nullable com.mongodb.WriteConcern writeConcern)
Sets the write concern- Specified by:
writeConcern
in interfaceWriteConfigurable<DeleteOptions>
- Parameters:
writeConcern
- the write concern- Returns:
- this
-
writeConcern
@Nullable public com.mongodb.WriteConcern writeConcern()
The write concern to use for the delete.- Specified by:
writeConcern
in interfaceWriteConfigurable<DeleteOptions>
- Returns:
- the write concern, or null if the default will be used.
-
-