Package io.vertx.ext.mongo
Class UpdateOptions
- java.lang.Object
-
- io.vertx.ext.mongo.UpdateOptions
-
public class UpdateOptions extends Object
Options for configuring updates.- Author:
- Nick Scavelli
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_MULTI
The default value of multi = falsestatic boolean
DEFAULT_RETURN_NEW_DOCUMENT
The default value of returning new document = falsestatic boolean
DEFAULT_UPSERT
The default value of upsert = false
-
Constructor Summary
Constructors Constructor Description UpdateOptions()
Default constructorUpdateOptions(boolean upsert)
Constructor specify upsertUpdateOptions(boolean upsert, boolean multi)
Constructor specify upsert and multiUpdateOptions(JsonObject json)
Constructor from JSONUpdateOptions(UpdateOptions other)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 enabledUpdateOptions
setArrayFilters(JsonArray arrayFilters)
Set the arrayFilters optionUpdateOptions
setCollation(CollationOptions collation)
Collation optionsUpdateOptions
setHint(JsonObject hint)
Set the hint.UpdateOptions
setHintString(String hintString)
Set the hint string.UpdateOptions
setMulti(boolean multi)
Set whether multi is enabledUpdateOptions
setReturningNewDocument(boolean returnNewDocument)
Set whether new document property is enabled.UpdateOptions
setUpsert(boolean upsert)
Set whether upsert is enabledUpdateOptions
setWriteOption(WriteOption writeOption)
Set the write optionJsonObject
toJson()
String
toString()
-
-
-
Field Detail
-
DEFAULT_UPSERT
public static final boolean DEFAULT_UPSERT
The default value of upsert = false- See Also:
- Constant Field Values
-
DEFAULT_MULTI
public static final boolean DEFAULT_MULTI
The default value of multi = false- See Also:
- Constant Field Values
-
DEFAULT_RETURN_NEW_DOCUMENT
public static final boolean DEFAULT_RETURN_NEW_DOCUMENT
The default value of returning new document = false- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UpdateOptions
public UpdateOptions()
Default constructor
-
UpdateOptions
public UpdateOptions(boolean upsert)
Constructor specify upsert- Parameters:
upsert
- the value of upsert
-
UpdateOptions
public UpdateOptions(boolean upsert, boolean multi)
Constructor specify upsert and multi- Parameters:
upsert
- the value of upsertmulti
- the value of multi
-
UpdateOptions
public UpdateOptions(UpdateOptions other)
Copy constructor- Parameters:
other
- the one to copy
-
UpdateOptions
public UpdateOptions(JsonObject json)
Constructor from JSON- Parameters:
json
- the json
-
-
Method Detail
-
getCollation
public CollationOptions getCollation()
-
setCollation
public UpdateOptions setCollation(CollationOptions collation)
Collation options- Parameters:
collation
-
-
getWriteOption
public WriteOption getWriteOption()
Get the write option.- Returns:
- the write option
-
setWriteOption
public UpdateOptions setWriteOption(WriteOption writeOption)
Set the write option- Parameters:
writeOption
- the write option- Returns:
- reference to this, for fluency
-
isUpsert
public boolean isUpsert()
Get whether upsert is enabled- Returns:
- upsert is enabled?
-
setUpsert
public UpdateOptions setUpsert(boolean upsert)
Set whether upsert is enabled- Parameters:
upsert
- true if enabled- Returns:
- reference to this, for fluency
-
isReturningNewDocument
public boolean isReturningNewDocument()
Get whether returning new document property is enabled. Valid only on findOneAnd* methods.- Returns:
- new document property is enabled?
-
setReturningNewDocument
public UpdateOptions setReturningNewDocument(boolean returnNewDocument)
Set whether new document property is enabled. Valid only on findOneAnd* methods.- Parameters:
returnNewDocument
- true if enabled- Returns:
- reference to this, for fluency
-
isMulti
public boolean isMulti()
Get whether multi is enabled. Multi means more than one document can be updated.- Returns:
- multi is enabled?
-
setMulti
public UpdateOptions setMulti(boolean multi)
Set whether multi is enabled- Parameters:
multi
- true if enabled- Returns:
- reference to this, for fluency
-
getArrayFilters
public JsonArray getArrayFilters()
Get the arrayFilters option.- Returns:
- the arrayFilters option
-
setArrayFilters
public UpdateOptions setArrayFilters(JsonArray arrayFilters)
Set the arrayFilters option- Parameters:
arrayFilters
- the arrayFilters option- Returns:
- reference to this, for fluency
-
getHint
public JsonObject getHint()
Get the hint.- Returns:
- the hint
-
setHint
public UpdateOptions setHint(JsonObject hint)
Set the hint.- Parameters:
hint
- the hint- Returns:
- reference to this, for fluency
-
getHintString
public String getHintString()
Get the hint string.- Returns:
- the hint string
-
setHintString
public UpdateOptions setHintString(String hintString)
Set the hint string.- Parameters:
hintString
- the hint string- Returns:
- reference to this, for fluency
-
toJson
public JsonObject toJson()
-
-