public class UpdateOptions extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_MULTI
The default value of multi = false
|
static boolean |
DEFAULT_RETURN_NEW_DOCUMENT
The default value of returning new document = false
|
static boolean |
DEFAULT_UPSERT
The default value of upsert = false
|
Constructor and Description |
---|
UpdateOptions()
Default constructor
|
UpdateOptions(boolean upsert)
Constructor specify upsert
|
UpdateOptions(boolean upsert,
boolean multi)
Constructor specify upsert and multi
|
UpdateOptions(JsonObject json)
Constructor from JSON
|
UpdateOptions(UpdateOptions other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
JsonArray |
getArrayFilters()
Get the arrayFilters option.
|
CollationOptions |
getCollation() |
JsonObject |
getHint()
Get the hint.
|
String |
getHintString()
Get the hint string.
|
WriteOption |
getWriteOption()
Get the write option.
|
int |
hashCode() |
boolean |
isMulti()
Get whether multi is enabled.
|
boolean |
isReturningNewDocument()
Get whether returning new document property is enabled.
|
boolean |
isUpsert()
Get whether upsert is enabled
|
UpdateOptions |
setArrayFilters(JsonArray arrayFilters)
Set the arrayFilters option
|
UpdateOptions |
setCollation(CollationOptions collation)
Collation options
|
UpdateOptions |
setHint(JsonObject hint)
Set the hint.
|
UpdateOptions |
setHintString(String hintString)
Set the hint string.
|
UpdateOptions |
setMulti(boolean multi)
Set whether multi is enabled
|
UpdateOptions |
setReturningNewDocument(boolean returnNewDocument)
Set whether new document property is enabled.
|
UpdateOptions |
setUpsert(boolean upsert)
Set whether upsert is enabled
|
UpdateOptions |
setWriteOption(WriteOption writeOption)
Set the write option
|
JsonObject |
toJson() |
String |
toString() |
public static final boolean DEFAULT_UPSERT
public static final boolean DEFAULT_MULTI
public static final boolean DEFAULT_RETURN_NEW_DOCUMENT
public UpdateOptions()
public UpdateOptions(boolean upsert)
upsert
- the value of upsertpublic UpdateOptions(boolean upsert, boolean multi)
upsert
- the value of upsertmulti
- the value of multipublic UpdateOptions(UpdateOptions other)
other
- the one to copypublic UpdateOptions(JsonObject json)
json
- the jsonpublic CollationOptions getCollation()
public UpdateOptions setCollation(CollationOptions collation)
collation
- public WriteOption getWriteOption()
public UpdateOptions setWriteOption(WriteOption writeOption)
writeOption
- the write optionpublic boolean isUpsert()
public UpdateOptions setUpsert(boolean upsert)
upsert
- true if enabledpublic boolean isReturningNewDocument()
public UpdateOptions setReturningNewDocument(boolean returnNewDocument)
returnNewDocument
- true if enabledpublic boolean isMulti()
public UpdateOptions setMulti(boolean multi)
multi
- true if enabledpublic JsonArray getArrayFilters()
public UpdateOptions setArrayFilters(JsonArray arrayFilters)
arrayFilters
- the arrayFilters optionpublic JsonObject getHint()
public UpdateOptions setHint(JsonObject hint)
hint
- the hintpublic String getHintString()
public UpdateOptions setHintString(String hintString)
hintString
- the hint stringpublic JsonObject toJson()
Copyright © 2024 Eclipse. All rights reserved.