public class BulkOperation extends Object
Constructor and Description |
---|
BulkOperation(JsonObject json)
Json constructor
|
Modifier and Type | Method and Description |
---|---|
static BulkOperation |
createDelete(JsonObject filter)
Create a new delete operation with the given filter
|
static BulkOperation |
createInsert(JsonObject document)
Create a new insert operation with the given document
|
static BulkOperation |
createReplace(JsonObject filter,
JsonObject document)
Create a new replace operation with the given filter and replace document
|
static BulkOperation |
createReplace(JsonObject filter,
JsonObject document,
boolean upsert)
Create a new replace operation with the given filter, replace document, and the upsert flag
|
static BulkOperation |
createUpdate(JsonObject filter,
JsonObject document)
Create a new update operation with the given filter and update document
|
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
|
boolean |
equals(Object o) |
CollationOptions |
getCollation() |
JsonObject |
getDocument()
Returns the document, used by insert, replace, and update operations
|
JsonObject |
getFilter()
Returns the filter document, used by replace, update, and delete operations
|
JsonObject |
getHint()
Returns the operation hint
|
String |
getHintString()
Returns the operation hint string
|
BulkOperationType |
getType()
Returns the operation type
|
int |
hashCode() |
boolean |
isMulti()
Returns the multi flag, used by update and delete operations
|
boolean |
isUpsert()
Returns the upsert flag, used by update and replace operations
|
BulkOperation |
setCollation(CollationOptions collation) |
BulkOperation |
setDocument(JsonObject document)
Sets the document, used by insert, replace, and update operations
|
BulkOperation |
setFilter(JsonObject filter)
Sets the filter document, used by replace, update, and delete operations
|
BulkOperation |
setHint(JsonObject hint)
Sets the operation hint
|
BulkOperation |
setHintString(String hintString)
Sets the operation hint string
|
BulkOperation |
setMulti(boolean multi)
Sets the multi flag, used by update and delete operations
|
BulkOperation |
setType(BulkOperationType type)
Sets the operation type
|
BulkOperation |
setUpsert(boolean upsert)
Sets the upsert flag, used by update and replace operations
|
JsonObject |
toJson()
Generate a json from this object
|
String |
toString() |
public BulkOperation(JsonObject json)
json
- the json objectpublic static BulkOperation createDelete(JsonObject filter)
filter
- the filterpublic static BulkOperation createInsert(JsonObject document)
document
- the document to insertpublic static BulkOperation createReplace(JsonObject filter, JsonObject document)
filter
- the filterdocument
- the replace documentpublic static BulkOperation createReplace(JsonObject filter, JsonObject document, boolean upsert)
filter
- the filterdocument
- the replace documentupsert
- the upsert flagpublic static BulkOperation createUpdate(JsonObject filter, JsonObject document)
filter
- the filterdocument
- the update documentpublic static BulkOperation createUpdate(JsonObject filter, JsonObject document, boolean upsert, boolean multi)
filter
- the filterdocument
- the update documentupsert
- the upsert flagmulti
- the multi flagpublic CollationOptions getCollation()
public BulkOperation setCollation(CollationOptions collation)
public JsonObject toJson()
public BulkOperationType getType()
public BulkOperation setType(BulkOperationType type)
type
- the operation typepublic JsonObject getFilter()
public BulkOperation setFilter(JsonObject filter)
filter
- the filter documentpublic JsonObject getDocument()
public BulkOperation setDocument(JsonObject document)
document
- the documentpublic boolean isUpsert()
public BulkOperation setUpsert(boolean upsert)
upsert
- the upsert flagpublic boolean isMulti()
public BulkOperation setMulti(boolean multi)
multi
- the mutli flagpublic JsonObject getHint()
public BulkOperation setHint(JsonObject hint)
hint
- the operation hintpublic String getHintString()
public BulkOperation setHintString(String hintString)
hintString
- the operation hint stringCopyright © 2023 Eclipse. All rights reserved.