Package io.vertx.ext.mongo
Class BulkOperation
- java.lang.Object
-
- io.vertx.ext.mongo.BulkOperation
-
public class BulkOperation extends Object
Contains all data needed for one operation of a bulk write operation.- Author:
- sschmitt
-
-
Constructor Summary
Constructors Constructor Description BulkOperation(JsonObject json)
Json constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BulkOperation
createDelete(JsonObject filter)
Create a new delete operation with the given filterstatic BulkOperation
createInsert(JsonObject document)
Create a new insert operation with the given documentstatic BulkOperation
createReplace(JsonObject filter, JsonObject document)
Create a new replace operation with the given filter and replace documentstatic BulkOperation
createReplace(JsonObject filter, JsonObject document, boolean upsert)
Create a new replace operation with the given filter, replace document, and the upsert flagstatic BulkOperation
createUpdate(JsonObject filter, JsonObject document)
Create a new update operation with the given filter and update documentstatic 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 flagboolean
equals(Object o)
CollationOptions
getCollation()
JsonObject
getDocument()
Returns the document, used by insert, replace, and update operationsJsonObject
getFilter()
Returns the filter document, used by replace, update, and delete operationsJsonObject
getHint()
Returns the operation hintString
getHintString()
Returns the operation hint stringBulkOperationType
getType()
Returns the operation typeint
hashCode()
boolean
isMulti()
Returns the multi flag, used by update and delete operationsboolean
isUpsert()
Returns the upsert flag, used by update and replace operationsBulkOperation
setCollation(CollationOptions collation)
BulkOperation
setDocument(JsonObject document)
Sets the document, used by insert, replace, and update operationsBulkOperation
setFilter(JsonObject filter)
Sets the filter document, used by replace, update, and delete operationsBulkOperation
setHint(JsonObject hint)
Sets the operation hintBulkOperation
setHintString(String hintString)
Sets the operation hint stringBulkOperation
setMulti(boolean multi)
Sets the multi flag, used by update and delete operationsBulkOperation
setType(BulkOperationType type)
Sets the operation typeBulkOperation
setUpsert(boolean upsert)
Sets the upsert flag, used by update and replace operationsJsonObject
toJson()
Generate a json from this objectString
toString()
-
-
-
Constructor Detail
-
BulkOperation
public BulkOperation(JsonObject json)
Json constructor- Parameters:
json
- the json object
-
-
Method Detail
-
createDelete
public static BulkOperation createDelete(JsonObject filter)
Create a new delete operation with the given filter- Parameters:
filter
- the filter- Returns:
- a new delete operation instance
-
createInsert
public static BulkOperation createInsert(JsonObject document)
Create a new insert operation with the given document- Parameters:
document
- the document to insert- Returns:
- a new insert operation instance
-
createReplace
public static BulkOperation createReplace(JsonObject filter, JsonObject document)
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
public static BulkOperation createReplace(JsonObject filter, JsonObject document, boolean upsert)
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
public static BulkOperation createUpdate(JsonObject filter, JsonObject document)
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
public CollationOptions getCollation()
-
setCollation
public BulkOperation setCollation(CollationOptions collation)
-
toJson
public JsonObject toJson()
Generate a json from this object- Returns:
- the json representation
-
getType
public BulkOperationType getType()
Returns the operation type- Returns:
- the operation type
-
setType
public BulkOperation setType(BulkOperationType type)
Sets the operation type- Parameters:
type
- the operation type- Returns:
- this for fluency
-
getFilter
public JsonObject getFilter()
Returns the filter document, used by replace, update, and delete operations- Returns:
- the filter document
-
setFilter
public BulkOperation setFilter(JsonObject filter)
Sets the filter document, used by replace, update, and delete operations- Parameters:
filter
- the filter document- Returns:
- this for fluency
-
getDocument
public JsonObject getDocument()
Returns the document, used by insert, replace, and update operations- Returns:
- the document
-
setDocument
public BulkOperation setDocument(JsonObject document)
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
public BulkOperation setUpsert(boolean upsert)
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
public BulkOperation setMulti(boolean multi)
Sets the multi flag, used by update and delete operations- Parameters:
multi
- the mutli flag- Returns:
- this for fluency
-
getHint
public JsonObject getHint()
Returns the operation hint- Returns:
- the operation hint
-
setHint
public BulkOperation setHint(JsonObject hint)
Sets the operation hint- Parameters:
hint
- the operation hint- Returns:
- this for fluency
-
getHintString
public String getHintString()
Returns the operation hint string- Returns:
- the operation hint string
-
setHintString
public BulkOperation setHintString(String hintString)
Sets the operation hint string- Parameters:
hintString
- the operation hint string- Returns:
- this for fluency
-
-