Package dev.morphia
Class DeleteOptions
- java.lang.Object
-
- com.mongodb.client.model.DeleteOptions
-
- dev.morphia.DeleteOptions
-
- All Implemented Interfaces:
dev.morphia.internal.SessionConfigurable<DeleteOptions>
,dev.morphia.internal.WriteConfigurable<DeleteOptions>
public final class DeleteOptions extends com.mongodb.client.model.DeleteOptions implements dev.morphia.internal.SessionConfigurable<DeleteOptions>, dev.morphia.internal.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)
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
-
-
-
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(com.mongodb.client.ClientSession clientSession)
Description copied from interface:dev.morphia.internal.SessionConfigurable
Set the client session to use for the insert.- Specified by:
clientSession
in interfacedev.morphia.internal.SessionConfigurable<DeleteOptions>
- Parameters:
clientSession
- the client session- Returns:
- this
-
clientSession
public com.mongodb.client.ClientSession clientSession()
Description copied from interface:dev.morphia.internal.SessionConfigurable
The client session to use for the insertion.- Specified by:
clientSession
in interfacedev.morphia.internal.SessionConfigurable<DeleteOptions>
- Returns:
- the client session
-
collation
public DeleteOptions collation(com.mongodb.client.model.Collation collation)
- Overrides:
collation
in classcom.mongodb.client.model.DeleteOptions
-
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 com.mongodb.WriteConcern writeConcern()
The write concern to use for the delete.- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<DeleteOptions>
- Returns:
- the write concern, or null if the default will be used.
-
writeConcern
public DeleteOptions writeConcern(com.mongodb.WriteConcern writeConcern)
Sets the write concern- Specified by:
writeConcern
in interfacedev.morphia.internal.WriteConfigurable<DeleteOptions>
- Parameters:
writeConcern
- the write concern- Returns:
- this
-
-