Class BulkOperation
java.lang.Object
io.vertx.ext.mongo.BulkOperation
Contains all data needed for one operation of a bulk write operation.
- Author:
- sschmitt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BulkOperationcreateDelete(JsonObject filter) Create a new delete operation with the given filterstatic BulkOperationcreateInsert(JsonObject document) Create a new insert operation with the given documentstatic BulkOperationcreateReplace(JsonObject filter, JsonObject document) Create a new replace operation with the given filter and replace documentstatic BulkOperationcreateReplace(JsonObject filter, JsonObject document, boolean upsert) Create a new replace operation with the given filter, replace document, and the upsert flagstatic BulkOperationcreateUpdate(JsonObject filter, JsonObject document) Create a new update operation with the given filter and update documentstatic BulkOperationcreateUpdate(JsonObject filter, JsonObject document, boolean upsert, boolean multi) Create a new update operation with the given filter, update document, the upsert flag, and multi flagbooleanReturns the document, used by insert, replace, and update operationsReturns the filter document, used by replace, update, and delete operationsgetHint()Returns the operation hintReturns the operation hint stringgetType()Returns the operation typeinthashCode()booleanisMulti()Returns the multi flag, used by update and delete operationsbooleanisUpsert()Returns the upsert flag, used by update and replace operationssetCollation(CollationOptions collation) setDocument(JsonObject document) Sets the document, used by insert, replace, and update operationssetFilter(JsonObject filter) Sets the filter document, used by replace, update, and delete operationssetHint(JsonObject hint) Sets the operation hintsetHintString(String hintString) Sets the operation hint stringsetMulti(boolean multi) Sets the multi flag, used by update and delete operationssetType(BulkOperationType type) Sets the operation typesetUpsert(boolean upsert) Sets the upsert flag, used by update and replace operationstoJson()Generate a json from this objecttoString()
-
Constructor Details
-
BulkOperation
-
-
Method Details
-
createDelete
Create a new delete operation with the given filter- Parameters:
filter- the filter- Returns:
- a new delete operation instance
-
createInsert
Create a new insert operation with the given document- Parameters:
document- the document to insert- Returns:
- a new insert operation instance
-
createReplace
Create a new replace operation with the given filter and replace document- Parameters:
filter- the filterdocument- the replace document- Returns:
- a new replace operation instance
-
createReplace
Create a new replace operation with the given filter, replace document, and the upsert flag- Parameters:
filter- the filterdocument- the replace documentupsert- the upsert flag- Returns:
- a new replace operation instance
-
createUpdate
Create a new update operation with the given filter and update document- Parameters:
filter- the filterdocument- the update document- Returns:
- a new update operation instance
-
createUpdate
public static BulkOperation createUpdate(JsonObject filter, JsonObject document, boolean upsert, boolean multi) Create a new update operation with the given filter, update document, the upsert flag, and multi flag- Parameters:
filter- the filterdocument- the update documentupsert- the upsert flagmulti- the multi flag- Returns:
- a new update operation instance
-
getCollation
-
setCollation
-
toJson
-
getType
-
setType
Sets the operation type- Parameters:
type- the operation type- Returns:
- this for fluency
-
getFilter
Returns the filter document, used by replace, update, and delete operations- Returns:
- the filter document
-
setFilter
Sets the filter document, used by replace, update, and delete operations- Parameters:
filter- the filter document- Returns:
- this for fluency
-
getDocument
Returns the document, used by insert, replace, and update operations- Returns:
- the document
-
setDocument
Sets the document, used by insert, replace, and update operations- Parameters:
document- the document- Returns:
- this for fluency
-
isUpsert
public boolean isUpsert()Returns the upsert flag, used by update and replace operations- Returns:
- the upsert flag
-
setUpsert
Sets the upsert flag, used by update and replace operations- Parameters:
upsert- the upsert flag- Returns:
- this for fluency
-
isMulti
public boolean isMulti()Returns the multi flag, used by update and delete operations- Returns:
- the multi flag
-
setMulti
Sets the multi flag, used by update and delete operations- Parameters:
multi- the mutli flag- Returns:
- this for fluency
-
getHint
-
setHint
Sets the operation hint- Parameters:
hint- the operation hint- Returns:
- this for fluency
-
getHintString
-
setHintString
Sets the operation hint string- Parameters:
hintString- the operation hint string- Returns:
- this for fluency
-
equals
-
hashCode
-
toString
-