public class UpdateOption extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FLG_UPDATE_KEEP_SHARDINGKEY
The sharding key in update rule is not filtered, when executing update or upsert.
|
static int |
FLG_UPDATE_ONE
The flag represent whether to update only one matched record or all matched records.
|
Constructor and Description |
---|
UpdateOption() |
Modifier and Type | Method and Description |
---|---|
void |
appendFlag(int flag)
Appends a new flag to the update option.
|
Object |
clone() |
void |
eraseFlag(int flag)
Erases the specified flag from the update option.
|
int |
getFlag()
Gets the flag option.
|
BSONObject |
getHint()
Gets the hint option.
|
UpdateOption |
setFlag(int flag)
Sets the flag option.
|
UpdateOption |
setHint(BSONObject hint)
Sets the hint option, default is null.
|
String |
toString() |
public static final int FLG_UPDATE_KEEP_SHARDINGKEY
public static final int FLG_UPDATE_ONE
public void appendFlag(int flag)
flag
- The update flag, the following values:
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void eraseFlag(int flag)
flag
- The update flag, the following values:
public int getFlag()
public BSONObject getHint()
public UpdateOption setFlag(int flag)
flag
- The update flag, default to be 0, the following values:
public UpdateOption setHint(BSONObject hint)
hint
- Specified the index used to scan data. e.g. {"":"ageIndex"} means using index
"ageIndex" to scan data(index scan); {"":null} means table scan. when hint is
null, database automatically match the optimal index to scan data.Copyright © 2023. All rights reserved.