Package com.mongodb.client.model
Class DeleteOptions
java.lang.Object
com.mongodb.client.model.DeleteOptions
The options to apply when deleting documents.
- Since:
- 3.4
- MongoDB documentation
- Remove documents
- Delete Command
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the collation optionsSets the comment for this operation.Sets the comment for this operation.Returns the collation optionsgetHint()
Gets the hint to apply.Gets the hint string to apply.getLet()
Add top-level variables to the operationSets the hint to apply.hintString
(String hint) Sets the hint to apply.Add top-level variables for the operationtoString()
-
Constructor Details
-
DeleteOptions
public DeleteOptions()
-
-
Method Details
-
getCollation
Returns the collation options- Returns:
- the collation options
- Since server release
- 3.4
-
collation
Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
- Since server release
- 3.4
-
getHint
Gets the hint to apply.- Returns:
- the hint, which should describe an existing index
- Since:
- 4.1
- Since server release
- 4.4
-
getHintString
Gets the hint string to apply.- Returns:
- the hint string, which should be the name of an existing index
- Since:
- 4.1
- Since server release
- 4.4
-
hint
Sets the hint to apply.- Parameters:
hint
- a document describing the index which should be used for this operation.- Returns:
- this
- Since:
- 4.1
- Since server release
- 4.4
-
hintString
Sets the hint to apply.Note: If
hint(Bson)
is set that will be used instead of any hint string.- Parameters:
hint
- the name of the index which should be used for the operation- Returns:
- this
- Since:
- 4.1
- Since server release
- 4.4
-
getComment
- Returns:
- the comment for this operation. A null value means no comment is set.
- Since:
- 4.6
- Since server release
- 4.4
-
comment
Sets the comment for this operation. A null value means no comment is set.For bulk operations use:
BulkWriteOptions.comment(String)
- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 4.6
- Since server release
- 4.4
-
comment
Sets the comment for this operation. A null value means no comment is set.For bulk operations use:
BulkWriteOptions.comment(BsonValue)
- Parameters:
comment
- the comment- Returns:
- this
- Since:
- 4.6
- Since server release
- 4.4
-
getLet
Add top-level variables to the operationThe value of let will be passed to all update and delete, but not insert, commands.
- Returns:
- the top level variables if set or null.
- Since:
- 4.6
- Since server release
- 5.0
-
let
Add top-level variables for the operationAllows for improved command readability by separating the variables from the query text.
For bulk operations use:
BulkWriteOptions.let(Bson)
- Parameters:
variables
- for the operation or null- Returns:
- this
- Since:
- 4.6
- Since server release
- 5.0
-
toString
-